Jump to content

Noindex for pagination


michal95nh

Recommended Posts

Hello, how I can add <META NAME="robots" CONTENT="noindex,follow"> for pagination in presta 1.7 ?

If I add <META NAME="robots" CONTENT="noindex,follow"> in pagination.tpl I have noindex for all category where is pagination. :(

 

{if $pagination.should_be_displayed}

  <hr class="mt-0 mb-5">

  <nav class="pagination">
    {block name='pagination_page_list'}
        <ul class="page-list list-inline">
          {foreach from=$pagination.pages item="page"}

            <li class="list-inline-item{if $page.current} current{/if}">
              {if $page.type === 'spacer'}
                <span class="spacer">&hellip;</span>
              {else}
                <a
                  rel="{if $page.type === 'previous'}prev{elseif $page.type === 'next'}next{else}nofollow{/if}"
                  href="{$page.url}"
                  class="{if $page.type === 'previous'}previous btn btn-primary mr-3 {elseif $page.type === 'next'}next btn btn-primary ml-3 {else}mr-2 {/if}{['disabled' => !$page.clickable, 'js-search-link' => true]|classnames}"
                >
                  {if $page.type === 'previous'}
                    {l s='Previous' d='Shop.Theme.Actions'}
                  {elseif $page.type === 'next'}
                    {l s='Next' d='Shop.Theme.Actions'}
                  {else}
                    {$page.page}
                  {/if}
                </a>
              {/if}
            </li>
          {/foreach}
        </ul>
    {/block}
  </nav>
{/if}

 

Link to comment
Share on other sites

Hello:

You should check some conditions in your TPL after adding your code. For example check if you are in pages 2, 3, 4.....

{if $smart.get.p > 1}
	{*add your code*}
{/if}

I hope this is what you are looking for if I understand well.

Regards

Link to comment
Share on other sites

  • 1 year later...

hi , i use this cod

{if $smart.get.p > 1}

<META NAME="robots" CONTENT="noindex,follow">

{/if}

in pagination.tpl but not working

pls someone help how can i can add <META NAME="robots" CONTENT="noindex,follow"> for pagination in presta 1.7

Link to comment
Share on other sites

  • 4 months later...
On 4/14/2021 at 2:43 PM, sajjads3 said:

hi , i use this cod

{if $smart.get.p > 1}

<META NAME="robots" CONTENT="noindex,follow">

{/if}

in pagination.tpl but not working

pls someone help how can i can add <META NAME="robots" CONTENT="noindex,follow"> for pagination in presta 1.7

Has anyone succeeded in the enterprise? I have the same problem with Prestashop 1.7.7 . Thanks.

Link to comment
Share on other sites

  • 2 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...