Hi,
At the moment I’m trying to port a website of ours to Kirby. We have a page which basically features a rather large accordion with customer reviews. Each accordion item is an invisible child of the page, and has a field with a unique ID which is used as the DOM-elements ID. The main reason for the ID’s is that we were able to easily link to a specific entry from, for example, our Facebook page.
As the number of items has grown rather large, I wanted to add pagination to that page. That itself worked without problems.
My problem at this point is that I still want to be able to link to a specific entry in my accordion. As Kirby does not seem to be able to detect our current url scheme (http://mydomain.com/myaccordionpage#eb-249) I now seperate the Id with a slash (http://mydomain.com/myaccordionpage/249). I was able to extract that number in a custom router and give it to the controller of that page.
I would now have to determine on which paginated page that particular item is, and tell the pagination object to display that page. Then on the template I could mark the correct item as active and to the scrolling via javascript, as I have done it until now.
Could anyone give me some advice on how to get the right set of paginated items from the controller to my template?
Any suggestions would be greatly appreciated
- Fredrik