core icon indicating copy to clipboard operation
core copied to clipboard

prev/next for header

Open Zeromax opened this issue 9 years ago • 4 comments

As requested in #3515 there was the prev/next added to the head. Doc: http://googlewebmastercentral.blogspot.de/2011/09/pagination-with-relnext-and-relprev.html

Original Implementation: https://github.com/contao/core/blob/fcd72f5241b91ede2feb3cbc22cb6230371a759b/system/modules/core/classes/Pagination.php#L294

It has been removed in 858e3d30390d41d566d2f1499154bf32837eb358 see #4141

That's the history ;)


So my suggestion is: Add it again, cause it is a Very important SEO feature.

Here is my Idea to discuss:

  1. Add a Checkbox to the List Modules, which can add a pagination
  2. If this checkbox is enabled -> add the prev | next link to the head like $GLOBALS['TL_HEAD']['prev'] = '<link rel="prev" href="' . $this->linkToPage($this->intPage - 1) . '"' . $strTagClose;
  3. Add to the hint, that the prev next is allowed only once per page

Any other ideas or suggestions?

Zeromax avatar Sep 17 '15 12:09 Zeromax

I'd love to have this feature again because, as Zeromax says, it's very important for SEO.

k-webdesign avatar Sep 24 '15 14:09 k-webdesign

You could add it in the template yourself if you had access to the pagination object allowing you to fetch the previous and next links, right? Just a hypothetical question but I can think of a backwards compatible way how to achieve this ;)

Toflar avatar Sep 25 '15 07:09 Toflar

Would be great if the prev/next links could be added again. To solve the issue with multiple modules with pagination on a page, the feature could be optional in the module setting.

dmolineus avatar May 10 '17 06:05 dmolineus

I have implemented this feature with a templatemodification easily for a book-nav (https://github.com/contao/core/issues/8607#issuecomment-269309595) The same could be done with the pagination-template (for news/events- lists) or even with reader-templates (might be sligtly more complicated) If you put these three cases on one page the next-url would always be a different url (next in site-tree, next couple of items in list, next in archive/calendar). I am not too much into SEO but multiple <link rel="next"...> in the <head> do not make sense at all but are totaly valid. A rel="next" attribute on the <a class="next" href="..">Next</a> pagination-link itself should definitely do no harm.

asaage avatar May 10 '17 11:05 asaage