Module

Archived
Forum
(read-only)

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
Mark Croxton

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
# 1
Developer
Bjørn Børresen

Cheers for that, I will add it to the next release :)

Bjørn

Danny Veiga
# 2
Danny Veiga

Hey Mark,

This worked great, exactly what I was looking for - thanks!