Wednesday, December 4, 2013

How to manage footer and header links in prestashop

1. Login to your PrestaShop admin panel and navigate to Modules -> Positions


how_to_manage_footer_and_header_links_in_PrestaShop15_txt1


Here you should search for ‘Top of pages’ position and check which module is used to display header links.


That would be TM links block in our case.


how_to_manage_footer_and_header_links_in_PrestaShop15_txt2


2. Connect via FTP to your domain and navigate to /modules/tmpermanentlinks folder. Here you should edit tmpermanentlinks-header.tpl file using any code editor.


The following lines of code:



<ul id="tmheaderlinks">
<li><a href="$link->getPageLink('index.php')" if="" $page_name="=" 'index'="" class="active" ="" if="">l s='home' mod='tmpermanentlinks'</a></li>
<li><a href="$link->getPageLink('prices-drop')" if="" $page_name="=" 'prices-drop'="" class="active" ="" if="">l s='specials' mod='tmpermanentlinks'</a></li>
<li><a href="$link->getPageLink('new-products')" if="" $page_name="=" 'new-products'="" class="active" ="" if="">l s='New products' mod='tmpermanentlinks'</a></li>
<li><a href="$link->getPageLink('my-account', true)" if="" $page_name="=" 'my-account'="" class="active" ="" if="">l s='Your Account' mod='tmpermanentlinks'</a></li>
<li><a href="$link->getPageLink('contact', true)" if="" $page_name="=" 'contact'="" class="active" ="" if="">l s='contact' mod='tmpermanentlinks'</a></li>
<li><a href="$link->getPageLink('sitemap')" if="" $page_name="=" 'sitemap'="" class="active" ="" if="">l s='sitemap' mod='tmpermanentlinks'</a></li>
</ul>

 



displays header links.


Each line of code represents one menu element. E.g:



<li><a href="$link->getPageLink('sitemap')" if="" $page_name="=" 'sitemap'="" class="active" ="" if="">l s='sitemap' mod='tmpermanentlinks'</a></li>

 



is displaying Sitemap menu element.


You should remove line of code in case you would like to delete some menu element. Or you should add a new line of code if you would like to add a new link to menu.


E.g. we will add link to Manufacturers page to header links section. URL to Manufacturers page is http://domain.com/index.php?controller=manufacturer


You should edit /modules/tmpermanentlinkstmpermanentlinks-header.tpl file using any code editor.


Search for the following code:



<ul id="tmheaderlinks">
<li><a href="$link->getPageLink('index.php')" if="" $page_name="=" 'index'="" class="active" ="" if="">l s='home' mod='tmpermanentlinks'</a></li>
<li><a href="$link->getPageLink('prices-drop')" if="" $page_name="=" 'prices-drop'="" class="active" ="" if="">l s='specials' mod='tmpermanentlinks'</a></li>
<li><a href="$link->getPageLink('new-products')" if="" $page_name="=" 'new-products'="" class="active" ="" if="">l s='New products' mod='tmpermanentlinks'</a></li>
<li><a href="$link->getPageLink('my-account', true)" if="" $page_name="=" 'my-account'="" class="active" ="" if="">l s='Your Account' mod='tmpermanentlinks'</a></li>
<li><a href="$link->getPageLink('contact', true)" if="" $page_name="=" 'contact'="" class="active" ="" if="">l s='contact' mod='tmpermanentlinks'</a></li>
<li><a href="$link->getPageLink('sitemap')" if="" $page_name="=" 'sitemap'="" class="active" ="" if="">l s='sitemap' mod='tmpermanentlinks'</a></li>
</ul>

 



and add a new line of code



<li><a href="$link->getPageLink('manufacturer')" if="" $page_name="=" 'manufacturer'="" class="active" ="" if="">l s='Manufacturer' mod='tmpermanentlinks'</a></li>

 



right below



<li><a href="$link->getPageLink('sitemap')" if="" $page_name="=" 'sitemap'="" class="active" ="" if="">l s='sitemap' mod='tmpermanentlinks'</a></li>

 



Let me explain what the meaning of the code:


href="$link->getPageLink('manufacturer')" we should insert a part of URL to the page. The part which goes right after controller=. That would be manufacturer in our case.


if $page_name == 'manufacturer'/if that part is for active highlighting. We should use the same value there.


l s='Manufacturer' mod='tmpermanentlinks' it is name of the button which is displayed on your site.


Now we will check which modules used to display links in footer of the site.


3. Navigate to Modules -> Positions in PrestaShop admin panel and search for Footer position.


how_to_manage_footer_and_header_links_in_PrestaShop15_txt3


These modules are used to display content for footer links section


how_to_manage_footer_and_header_links_in_PrestaShop15_txt4


Here you can see which content they are displaying


4. CMS Block is displaying CMS pages. You can navigate to Modules -> Modules section, search for CMS block, Configure it and select which pages to display on the page.


Our Stores link is displaying in CMS block if Display in the footer option is enabled under Preferences -> Store Contacts section


how_to_manage_footer_and_header_links_in_PrestaShop15_txt5


Our offers links should be edited in /themes/themeXXX/modules/blockcms/blockcms.tpl file. Where themeXXX is your theme folder name.


The following code is displaying Our offers section:



<ul>
if !$PS_CATALOG_MODE<li class="first_item"><a href="$link->getPageLink('prices-drop')" title="l s='Specials' mod='blockcms'">l s='Specials' mod='blockcms'</a></li>/if
<li class="if $PS_CATALOG_MODEfirst_/ifitem"><a href="$link->getPageLink('new-products')" title="l s='New products' mod='blockcms'">l s='New products' mod='blockcms'</a></li>
if !$PS_CATALOG_MODE<li class="item"><a href="$link->getPageLink('best-sales')" title="l s='Top sellers' mod='blockcms'">l s='Top sellers' mod='blockcms'</a></li>/if
if !$PS_CATALOG_MODE<li class="item"><a href="$link->getPageLink('manufacturer')" title="l s='Manufacturers' mod='blockcms'">l s='Manufacturers' mod='blockcms'</a></li>/if
if !$PS_CATALOG_MODE<li class="item"><a href="$link->getPageLink('supplier')" title="l s='Suppliers' mod='blockcms'">l s='Suppliers' mod='blockcms'</a></li>/if
if !$PS_CATALOG_MODE<li class="item"><a href="$link->getPageLink('sitemap')" title="l s='Sitemap' mod='blockcms'">l s='Sitemap' mod='blockcms'</a></li>/if
</ul>

 



Each line of code represents one menu element. The syntax is the same as in /modules/tmpermanentlinks/tmpermanentlinks-header.tpl file.


5. My Account block on footer is displaying My account section. You can enable or disable that block under Modules -> Modules in your PrestaShop admin panel.


6. Block social is displaying Follow us section. Navigate to Modules -> Modules in your PrestaShop admin panel and search for Block social in list of blocks. Click Configure link to edit it.


how_to_manage_footer_and_header_links_in_PrestaShop15_txt6


Here you can update links for each social icon.


 


7. Block contact infos is displaying Contact us section. You may edit block under Modules -> Modules in your PrestaShop admin panel.


Click Configure button to edit block.


how_to_manage_footer_and_header_links_in_PrestaShop15_txt7


There you may update contact info which is displaying in the footer of your site


how_to_manage_footer_and_header_links_in_PrestaShop15_txt9



How to manage footer and header links in prestashop

No comments:

Post a Comment