Features / Usability

Features / Usability

[SOLVED] Adding metatags on Smarty template based on tracker item (plugin List)

posts: 8618 Israel


I display trackeritems using a plugin List and smarty template.
Adding to this prefix alias allow me to display each item dynamically in the template.

I need to change also the metatags for each page displayed accordingly to the item. (title, description and keywords)
I added metatag wiki plugin inside the template foreach:

Copy to clipboard
{wikiplugin _name="metatag" name="description" content="{$row.basecontent|truncate:200}"}{/wikiplugin} {wikiplugin _name="metatag" name="title" content="{$row.title}"}{/wikiplugin} {wikiplugin _name="metatag" name="keywords" content="{$row.basetags}"}{/wikiplugin}

While this work, I wonder if there is not a simpler / more elegant way ?

posts: 8618 Israel
Jonny Bradley wrote:

You can use pagetitle="y" or pagedescription="y" in your list plugin display tags for those two - i guess we could add a pagekeywords one but i don't think the search engines take any notice of that one any more... confused

Documented here: https://doc.tiki.org/PluginList-display-control-block#Parameters

Thanks Jonny, I wouldn't have check there (neither Google or DuckDuckGo 🤣)

I created : https://doc.tiki.org/PluginList-and-Metatags
Feel free to improve.