Jump to content

Pagination with link rel meta tags in Prestashop 1.4


fatyas

Recommended Posts

Hi,

 

I am trying to solve the google duplicates due to pagination.

Can somebody help me add the recommended rel=next and rel=prev in the header of the pages for prestashop 1.4.

 

I have tried adding the code below unfortunately it works in pagination.tpl but not in header.tpl:

 
{if $start!=$stop}
{if $p != 1}
{assign var='p_previous' value=$p-1}
<link rel="prev" href="/{$request_uri|substr:1|regex_replace:'/\/(.*)/':''|regex_replace:'/\?(.*)/':''}/{$link->goPage($requestPage, $p_previous)}" />
  {else}
 
{/if}
{if $pages_nb > 1 AND $p != $pages_nb}
{assign var='p_next' value=$p+1}
<link rel="next" href="/{$request_uri|substr:1|regex_replace:'/\/(.*)/':''|regex_replace:'/\?(.*)/':''}/{$link->goPage($requestPage, $p_next)}" />
{else}
 
{/if}
{/if}
 
How can I make it work in header.tpl?
 
Thanks,
Faty
Link to comment
Share on other sites

  • 3 months later...
  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...