lynnmcdee Posted June 22, 2015 Share Posted June 22, 2015 Hello,I wondered if anyone can help? At the moment my website has alot of categories and therefore there are alot of links on each webpage. I would like the links from the category page to be noindex/follow so any 'link juice' is maintained the actual content is not looked at on that page. The actual products it is linked to will still be indexed and so no worries about blocking Google. The following code is in the template file. Or, should I be looking at something else?{if $SECTION_NAME=='category' AND $smarty.get.page > 1} <meta name="robots" content="noindex, follow" /> {elseif $smarty.get.page == 'all'} <meta name="robots" content="noindex, follow" /> {else} <meta name="robots" content="index, follow" /> {/if} Kind regardsLynn Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 22, 2015 Share Posted June 22, 2015 If this code was in the <head> section, it should work.But there should also be something in the robots.txt file, but that would be very difficult to enumerate all the category names. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 22, 2015 Share Posted June 22, 2015 Although, the Smarty reserved variable name of $smarty may work, it may also be misleading if you got the idea from the Smarty documentation site.If things aren't working well, I would try: $GLOBALS['smarty'].get.page Quote Link to comment Share on other sites More sharing options...
lynnmcdee Posted June 22, 2015 Author Share Posted June 22, 2015 Hi Brian,Thank you for your reply.Yes, the code is in the <head> section.Where should I add this $GLOBALS['smarty'].get.page?CheersLynn Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 22, 2015 Share Posted June 22, 2015 Again, if you are not getting what you want, instead of this variable:$smarty.get.page > 1Try using this:$GLOBALS['smarty'].get.page > 1and the other instance. Quote Link to comment Share on other sites More sharing options...
lynnmcdee Posted June 22, 2015 Author Share Posted June 22, 2015 Thanks Brian.It is now showing {if $SECTION_NAME=='category' AND $GLOBALS['smarty'].get.page > 1} <meta name="robots" content="noindex, follow" /> {elseif $smarty.get.page == 'all'} <meta name="robots" content="noindex, follow" /> {else} <meta name="robots" content="index, follow" /> {/if}Unfortunately it has not worked Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 22, 2015 Share Posted June 22, 2015 My experiments do show that $smarty is the correct variable. So, this should work:{if $SECTION_NAME=='category' && $smarty.get.page > 1} <meta name="robots" content="noindex, follow" /> {elseif $smarty.get.page == 'all'} <meta name="robots" content="noindex, follow" /> {else} <meta name="robots" content="index, follow" /> {/if}Because a template has been edited, you may need to clear the skin cache (admin, Maintenance, Rebuild tab). Quote Link to comment Share on other sites More sharing options...
lynnmcdee Posted June 23, 2015 Author Share Posted June 23, 2015 I have cleared the skin cache. Unfortunately it has not worked. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.