Page 1 of 1
Search Module question..
Posted: Fri Nov 02, 2012 1:07 pm
by Minefox
Hi! Is there a way for the "search module" to search thru metadata?
Like searching thru keywords..
Re: Search Module question..
Posted: Fri Nov 02, 2012 11:12 pm
by mrenigma
The only way I think this might work is to create a "keywords" content block with all your keywords used within your meta.
Then that would be applied to the "keywords" meta tag in your template and the search function could pick it up.
Re: Search Module question..
Posted: Sat Nov 03, 2012 6:39 am
by Minefox
mrenigma,
can you show me how to put a content block in a meta tag?
Re: Search Module question..
Posted: Sat Nov 03, 2012 10:31 pm
by mrenigma
Hi Minefox,
The easiest way would be to have your header stored in a Global Content Block and then on your template write something similar to this:
Code: Select all
{content block="metaKeywords" label="Meta Keywords" oneline=true assign="keywords"}
{global_content name="header"}
... rest of template ...
Within the header template you would want to then call:
Code: Select all
.. Usual start to HTML and <head> ...
{if !empty($keywords)}
<meta name="keywords" content="{$keywords}" />
{/if}
.. Rest of HTML header ...
Re: Search Module question..
Posted: Sat Nov 03, 2012 10:46 pm
by calguy1000
can you show me how to put a content block in a meta tag?
Easiest way would be something like:
<meta name="keywords" content="{content block='keywords' oneline='true' label='Enter SEO keywords here'}"/>
Re: Search Module question..
Posted: Sun Nov 04, 2012 12:32 am
by Minefox
Hi calguy1000,
Got your code working in my specific page. But still the Search function was not able to find the keyword i placed inside the content block. ie
In Content Block the keywords are "
Minefox, Dude". This content block is specific for a certain page. Inside the page, I put in the Page Specific Metadata a code that looks like this
<meta name="keywords" content="{global_content name='keyword1' oneline='true' label='SEO keyword'}"/>
Re: Search Module question..
Posted: Sun Nov 04, 2012 9:32 am
by mrenigma
Have you tried going to the Search module under "Extensions" and clicking the "reindex" button?