I want to add a canonical statement to a template to prevent Google indexing the same page with different URL's. Something like:
<link rel="canonical" href="http://www.safari-club.co.uk/botswana-safaris" />
Unfortunately CMS does not seem to provide a tag for a page alias or preferably its full url so that a generic statement can be added to a template rather than having to add and edit the above to every single page. Any ideas?
Tag to insert a page's URL in its own HTML script
Re: Tag to insert a page's URL in its own HTML script
You haven't seen this in the top of any of the default templates?...
{if isset($canonical)}
<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}
<link rel="canonical" href="{$content_obj->GetURL()}" />
{/if}
You may want to look in extensions > tags to see ones that can be used like {title}, {sitename}, etc., there is also {$page_alias}...
{if isset($canonical)}
<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}
<link rel="canonical" href="{$content_obj->GetURL()}" />
{/if}
You may want to look in extensions > tags to see ones that can be used like {title}, {sitename}, etc., there is also {$page_alias}...
Re: Tag to insert a page's URL in its own HTML script
Brilliant, thanks, it works. I spent all afternoon looking through the CMS. No not on the top of any of the templates. Can't see tags like {$page_alias} anywhere either.