SEO Lite
ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4
Back to this add-on's main page
View Other Add-ons From Bjorn Borresen
Suggested improvement - use as a tag pair
General
Mark Croxton
|
Posted: 03 May 2011 11:58 AM |
|
|
|
Great add-on!
But - I would prefer to use as a tag pair:
{exp:seo_lite entry_id="{entry_id}"} <meta name="keywords" content="{meta_keywords}" /> <meta name="description" content="{meta_description}" /> {/exp:seo_lite}
To make seo lite work as a tag pair this look for this line in mod.seo_lite.php (around line 92):
$tagdata = $seolite_entry->template;
And change to:
$tagdata = $this->EE->TMPL->tagdata; if ( empty($tagdata) ) { $tagdata = $seolite_entry->template; }
Why bother? Because I can then capture the values and reuse elsewhere in my templates, eg:
{exp:seo_lite entry_id="{entry_id}" parse="inward"} {exp:stash:set} {stash:meta_keywords}{meta_keywords}{/stash:meta_keywords} {stash:meta_description}{meta_description}{/stash:meta_description} {/exp:stash:set} {/exp:seo_lite}
Now I can output anywhere with {exp:stash:get name=“meta_keyword”} and {exp:stash:get name=“meta_description”}
|
|
|
Bjørn Børresen
|
Posted: 05 May 2011 10:05 AM |
# 1
|
|
Developer
|
Cheers for that, I will add it to the next release :)
Bjørn
|
|
|
Danny Veiga
|
Posted: 04 August 2011 02:29 PM |
# 2
|
|
|
Hey Mark,
This worked great, exactly what I was looking for - thanks!
|
|
|