Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Search #237

Open
ramesh-dada opened this issue Jun 26, 2021 · 10 comments
Open

[Feature request] Search #237

ramesh-dada opened this issue Jun 26, 2021 · 10 comments

Comments

@ramesh-dada
Copy link

ramesh-dada commented Jun 26, 2021

I want to add some codes in head tag in order to improve seo I mean I have to add schema tags and all that, I also need Search Page in order to search whole website for the query, and at last I need Sitemap.xml as It is very important for indexing.

For head items I mean something like a title and description field is shown on every page so all i want is a custom head html field should also be shown but html in that work only on that page. and the other field should shown in settings in which the code we add should added on all pages automatically.

@robiso
Copy link
Collaborator

robiso commented Jul 2, 2021

@ramesh-dada

  1. Adding some better HTML head items is as easy as including this in your theme:
	<head>
        <!-- Encoding, browser compatibility, viewport -->
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    		<meta http-equiv="X-UA-Compatible" content="IE=edge">
    		<meta name="viewport" content="width=device-width, initial-scale=1">

        <!-- Search Engine Optimization (SEO) -->
    		<meta name="title" content="<?= $Wcms->get('config', 'siteTitle') ?> - <?= $Wcms->page('title') ?>" />
    		<meta name="description" content="<?= $Wcms->page('description') ?>">
    		<meta name="keywords" content="<?= $Wcms->page('keywords') ?>">
    		<meta property="og:url" content="<?= $this->url() ?>" />
    		<meta property="og:type" content="website" />
    		<meta property="og:site_name" content="<?= $Wcms->get('config', 'siteTitle') ?>" />
    		<meta property="og:title" content="<?= $Wcms->page('title') ?>" />
    		<meta name="twitter:site" content="<?= $this->url() ?>" />
    		<meta name="twitter:title" content="<?= $Wcms->get('config', 'siteTitle') ?> - <?= $Wcms->page('title') ?>" />
    		<meta name="twitter:description" content="<?= $Wcms->page('description') ?>" />
    		<title><?= $Wcms->get('config', 'siteTitle') ?> - <?= $Wcms->page('title') ?></title>

        <!-- Theme CSS -->
    		<link rel="preload stylesheet" as="style" href="<?= $Wcms->asset('css/style.css') ?>">
    		
        <!-- Admin CSS -->
    		<?= $Wcms->css()?>

	</head>
  1. Sitemap plugin is available here: https://github.com/StephanStanisic/simple-seo
  2. Searching is a specific challenge, if anyone would be interested in taking a look for developing this, I'd love to give it a try.

I've edited this reports title so it reflects the only feature request that doesn't exist: Search

@robiso robiso changed the title Feature Request : Search Page, HTML Head Items and SEO Sitemap [Feature Request] Search Page Jul 2, 2021
@robiso robiso changed the title [Feature Request] Search Page [Feature Request] Search Jul 2, 2021
@robiso robiso changed the title [Feature Request] Search [Feature request] Search Jul 2, 2021
@DaddyMadu
Copy link

DaddyMadu commented Jan 15, 2022

@robiso https://github.com/StephanStanisic/simple-seo is outdated and once installed it gives internal server error. i already removed it and cleaned my database.js from this custom repo. can you help with that
i feel like wcms should have included and maintaining this option by default as built in feature not as a separate plugin for better seo and indexing

@robiso
Copy link
Collaborator

robiso commented Jan 15, 2022

@DaddyMadu I've updated the Simple SEO plugin and forked it from the original author Stephan Stanisic.

It's now included in the official list of plugins, so make sure to uninstall the one you have and remove it completely from your website and then installing it from the Settings -> Plugins.

We try not to include too much functionality into WonderCMS to retain it's mission for small size, thus we use plugins and depend on maintainers/contributors, as the "core" should be as clean as possible without having to maintain too much different aspects.

@DaddyMadu
Copy link

@robiso thank you very much for that swifty replay!
i know how what you are talking about but such functionality nowadays is a must in any basic installation.
any way thanks for taking care of it, and hope the best for you guys out there
you have such an amazing project keep it up!

@robiso
Copy link
Collaborator

robiso commented Jan 16, 2022

You're welcome @DaddyMadu, but please note that everyone has an opinion on what are the "basic" things that should be included in WonderCMS.

We try to be impartial and try to provide/support the community with plugins and let the users decide on what they would want included.
The other benefit here is maintenance, as the "core team" is trying to keep the WonderCMS core up to date and safe, without being too distracted with themes and plugins.

Appreciate the support and thanks for your feedback.

@robiso robiso pinned this issue Jan 29, 2022
@joho1968
Copy link

As for search ... I think it'd be a good idea to implement some hooks for this.

  • It would be theme independent
  • It won't break anything for themes that don't support it
  • It allows themes to place a "search box" wherever

Something like "search_paint" or "paint_search" maybe, if you want to have other "paint_"-like hooks for other things in the future.

I can certainly give the search thing a try, and try to implement it in my Bootstrap 5 theme for WonderCMS.

@joho1968
Copy link

Come to think of it, it probably needs to be the other way around. The theme should implement this, and then be able to call a public core function (?) that returns an array that is either empty, or matching content. The array could contain pairs, like ['thisistheurl' => 'matching text highlight'], or pairs like ['url' => 'page title'], or just a simple a list of URLs. But the page title would be nice to get for display.

@joho1968
Copy link

The latest version of the WonderCMS BS5 theme now includes a search function that will search WonderCMS content as well as the Simple Blog plugin content.

@robiso
Copy link
Collaborator

robiso commented Nov 1, 2023

@joho1968 this sounds pretty AMAZING. Will check it out if we can somehow include it either natively or via a plugin. Amazing effort :)

@joho1968
Copy link

joho1968 commented Nov 6, 2023

Yeah, I think native search hooks would be a great idea. I do think it should be in core. I mean, if you look at my code in the BS5 theme, it's really not that many lines of code, nor is it very complicated 😊 I'll keep it in my theme until you make a decision on core/native functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants