Jump to content

Add "- Page 2" to metatags


Recommended Posts

Dear friends

 

How can i setup to have on mysite.com/2/ my title with <title>My Seo Title - Page 2</title> and in the rest of paginations?

 

Tried this

<title>{{$page_title|mb_ucfirst|default:$lang.html.default_title}} {{if $nav.page now>1}}{{$lang.common list.paginated postfix|replace:"%1%":$nav.page_now}}{{/if}}</title>

but dont works

Link to comment
Share on other sites

There is no easy way to do that... First of all KVS default theme should automatically add Page number, for example like here:

https://www.kvs-demo.com/latest-updates/2/

This is done by the following code in each page where applicable:

{{if $storage.list_albums_common_albums_list.page_now>1}}
	{{if $page_title!=''}}
		{{assign var="page_title" value=$lang.html.default_paginated_title|replace:"%1%":$page_title|replace:"%2%":$storage.list_albums_common_albums_list.page_now}}
	{{/if}}
	{{if $page_description!=''}}
		{{assign var="page_description" value=$lang.html.default_paginated_description|replace:"%1%":$page_description|replace:"%2%":$storage.list_albums_common_albums_list.page_now}}
	{{/if}}
{{/if}}

The code is different for every page, but looks very similar. You can find all such places by going to Website UI -> Search in theme and searching for $lang.html.default_paginated_title in templates.

This will give a list of page templates with similar code blocks. Now for adding noindex, you need to put the following line inside the first {{if}} condition:

{{assign var="page_noindex" value="true"}}

E.g. for the above example of code it should become like this:

{{if $storage.list_albums_common_albums_list.page_now>1}}
	{{assign var="page_noindex" value="true"}}
	{{if $page_title!=''}}
		{{assign var="page_title" value=$lang.html.default_paginated_title|replace:"%1%":$page_title|replace:"%2%":$storage.list_albums_common_albums_list.page_now}}
	{{/if}}
	{{if $page_description!=''}}
		{{assign var="page_description" value=$lang.html.default_paginated_description|replace:"%1%":$page_description|replace:"%2%":$storage.list_albums_common_albums_list.page_now}}
	{{/if}}
{{/if}}

Then you need to go to Website UI -> Page components -> include_header_general.tpl and add this block anywhere inside <head> section:

{{if $page_noindex=='true'}}
    <meta name="robots" content="noindex" />
{{/if}} 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...