plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
246 stars 187 forks source link

Implement pagination with rel=“next” and rel=“prev” #1325

Open hvelarde opened 8 years ago

hvelarde commented 8 years ago

Sequence of pages where each one can have a previous sibling and a next sibling should implement HTML elements <link rel="prev" href="..." /> and <link rel="next" href="..." /> to indicate the relationship among them.

Search engines use this information to consolidate indexing properties and send users to the most relevant page (typically the first page of the series).

We propose to implement this in both Plone 4.3 and Plone 5.0.

More information:

rodfersou commented 8 years ago

At my first attempt with this issue, I try to add a new viewlet at plone.batching package to try to use the batch object to get when should I add the next and prev links in the head. After reading some code I saw that I could not share the batch object between the navigation view (or macro) and the viewlet.

Than I try to fill the head_slot in the navigation macro, and it broke the folder_contents view because it could not insert the main_template macro in the folder_contents view.

The last attempt was to set a request parameter in the view and try to get it into the viewlet.. and it didn't work too. the viewlet is evaluated first and the request still didn't have the variables set.

My other idea was to use a transform, like we do into collective.lazysizes, but didn't try it yet.

hvelarde commented 8 years ago

if someone at the @plone/framework-team has an idea on how to implement this, please let us know.