I’m looking to create a simple slider with the jQuery scrollTo and localScroll plugins. I can’t find the solution, but I’m sure I’m close to it.
Here’s the relevant code of the working static version :
<div id="content">
<div id="scroller">
<div class="page" id="1">
<!-- content here -->
<a href="#2">Read more...</a>
</div
<div class="page" id="2">
<!-- content here -->
<a href="#3">Read more...</a>
</div>
<!-- etc.... -->
</div>
</div>
The jQuery plugin uses the link to scroll to the right anchor.
In Modx, I’ve created a container page (empty for now, menuId of 57). The content of the subpages are displayed in the various <div class="page">
In the template :
<div id="content">
<div id="scroller">
[!Ditto? &parents=`57` &display=`all` &idType=`documents` &sortBy=`id` &sortDir=`ASC` &tpl=`page-content`!]
</div>
</div>
The chunk used by Ditto :
<div class="page" id="[+id+]">
<h2>[+title+]</h2>
[+content+]
<a href=" " title="[+title+]">Lire la suite...</a>
</div>
Everything is fine except the href attribute of the link. I can’t figure what to write there. I want to have something like "[+id+] plus 1" but can’t find the proper expression. I’ve tried the [+next+] placeholder, but it doesn’t return the value of the subpages :/ I’ve tried to put the [+id+] value in a php variable to manually add 1, but I didn’t write it right either.
I’m really stuck. Can someone help me please ?
Thanks !