rel=“next” and rel=“prev” to head from paginator component

5 years ago

Morfeo21
Backer | 35
+
0
-

Hi!

I have control ProductList which takes parameters from presenter and according them selects and renders products. As well it creates Paginator control and renders it. But now I want to add tags

<link rel="prev" href="..." />
<link rel="next" href="..." />

to head section. Logically it should be Paginator control's responsibility. But I have no idea how to put these tags to head section of the page, when ProductList control is rendered in body.

Did anybody sorted it out yet? I'll appreciate any advice :)

Thanks! :)

5 years ago

Filip Procházka
Moderator | 4693
+
0
-

You should create paginator component, that accepts the other component (or it's internal paginator) for reading only and render what you need.

It should probably be done using setter, so you can change it for each presenter in every component factory.

5 years ago

Morfeo21
Backer | 35
+
0
-

So if I get it right, I should create something like HeadPaginatorComponent. To this component I'll pass my ProductListComponent for reading the exact page and set prev and next links. Right? :) Hope I can make it :)) Thanks for your help! :)