Page 1 of 1

Meta and Rel tags for individual pages

Posted: Wed Jan 29, 2020 4:01 am
by jmglastetter
I'm currently using the HTML nugget plugin to insert into the head for site-wide information.

Needing to insert robot meta tags and rel canonical tags to the head of individual static pages.

Is there a way to do this, maybe another plugin I'm overlooking?

Re: Meta and Rel tags for individual pages

Posted: Sat Feb 01, 2020 8:26 pm
by yellowled
Not specifically for robots and canonical, I think.

A lot the more modern themes included in the s9y core add these in their index.tpl, for example 2k11. If you're using an older theme and don't want to switch, you could just add the respective lines to your index.tpl (in the <head> area, of course).

Code: Select all

{if ($view == "entry" || $view == "start" || $view == "feed" || $view == "plugin" || $staticpage_pagetitle != "" || $robots_index == 'index')}
    <meta name="robots" content="index,follow">
    <meta name="robots" content="noindex,follow">
{if ($view == "entry")}
    <link rel="canonical" href="{$entry.rdf_ident}">
{if ($view == "start")}
    <link rel="canonical" href="{$serendipityBaseURL}">