Meta and Rel tags for individual pages

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
jmglastetter
Regular
Posts: 16
Joined: Fri Dec 14, 2018 6:27 am

Meta and Rel tags for individual pages

Post 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?
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Meta and Rel tags for individual pages

Post 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">
{else}
    <meta name="robots" content="noindex,follow">
{/if}
{if ($view == "entry")}
    <link rel="canonical" href="{$entry.rdf_ident}">
{/if}
{if ($view == "start")}
    <link rel="canonical" href="{$serendipityBaseURL}">
{/if}
YL
Post Reply