dorje Posted August 30, 2013 Share Posted August 30, 2013 (edited) Hi all I am looking for a way to add a certain link in certain pages such as category pages, and in some product pages but mainly in category pages. I did it by adding the link in header.tpl but the link is showing in all over the pages ie in whole shop. so just wanna know how can i do that I found a similar trick here but not for the exact problem. < Its for removing the shop name in title and vekia also solved the problem to remove the title from specific pages >. So its kinda similar i guess. http://mypresta.eu/e...from-title.html So is there any way to do that thing and just to get the link in category pages and other pages not mainly for home page and blog pages.? Edited August 30, 2013 by dorje (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 30, 2013 Share Posted August 30, 2013 you want to add link on category page only? use this: {if isset($smarty.get.controller)} {if $smarty.get.controller=="category"} HERE YOUR LINK CODE {/if} {/if} or {if isset($smarty.get.id_category)} HERE YOUR LINK CODE {/if} Link to comment Share on other sites More sharing options...
dorje Posted August 30, 2013 Author Share Posted August 30, 2013 which one should i use. Actually i want to show This tag only in category pages and for some product pages <link href="https://plus.google.com/114618515309078933394/" rel="author"> But i dont want to show it in home page and in any blog pages such as http://www.kathmanduclothing.com/blog/all-post.html . So can i use this code for all these things Link to comment Share on other sites More sharing options...
dorje Posted August 30, 2013 Author Share Posted August 30, 2013 hey this code is not working, i put it in header.tpl but still cant see the link . i did turn off the cache and turned on the force complie but no link anywhere. {if isset($smarty.get.controller)} {if $smarty.get.controller=="category"} HERE YOUR LINK CODE {/if} {/if} Link to comment Share on other sites More sharing options...
vekia Posted August 30, 2013 Share Posted August 30, 2013 can you show how your header file looks like with this code? Link to comment Share on other sites More sharing options...
dorje Posted September 1, 2013 Author Share Posted September 1, 2013 (edited) This is the header.tpl i cant see the code in category pages and also in main page. < cant upload the headerfile here - why > {* * 2007-2011 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2011 PrestaShop SA * @version Release: $Revision: 1.4 $ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$lang_iso}"> <head> <title>{$meta_title|escape:'htmlall':'UTF-8'}</title> {if isset($meta_description) AND $meta_description} <meta name="description" content="{$meta_description|escape:html:'UTF-8'}" /> {/if} {if isset($meta_keywords) AND $meta_keywords} <meta name="keywords" content="{$meta_keywords|escape:html:'UTF-8'}" /> {/if} <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> <meta name="generator" content="PrestaShop" /> <meta name="robots" content="{if isset($nobots)}no{/if}index,follow" /> <link rel="icon" type="image/vnd.microsoft.icon" href="{$img_ps_dir}favicon.ico?{$time}" /> <link rel="shortcut icon" type="image/x-icon" href="{$img_ps_dir}favicon.ico?{$time}" /> <script type="text/javascript"> var baseDir = '{$content_dir}'; var static_token = '{$static_token}'; var token = '{$token}'; var priceDisplayPrecision = {$priceDisplayPrecision*$currency->decimals}; var priceDisplayMethod = {$priceDisplay}; var roundMode = {$roundMode}; </script> {if isset($css_files)} {foreach from=$css_files key=css_uri item=media} <link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" /> {/foreach} {/if} {if isset($smarty.get.controller)} {if $smarty.get.controller=="category"} <link href="https://plus.google.com/114618515309078933394/" rel="author"> {/if} {/if} <link href="https://plus.google.com/111412475881065779442" rel="publisher" /> <!--[if IE 7]> <link rel="stylesheet" href="{$base_dir}themes/electroshop/css/ie.css" type="text/css" media="screen" /> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" href="{$base_dir}themes/electroshop/css/ie8.css" type="text/css" media="screen" /> <![endif]--> {if isset($js_files)} {foreach from=$js_files item=js_uri} <script type="text/javascript" src="{$js_uri}"></script> {/foreach} {/if} {$HOOK_HEADER} </head> Edited September 1, 2013 by dorje (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted September 1, 2013 Share Posted September 1, 2013 i checked your code on my demo store and everything works well. On each category page code displays line with <link href="https://plus.google.com/114618515309078933394/" rel="author"> Link to comment Share on other sites More sharing options...
Recommended Posts