Hi,
I am a C#.Net developer, wanting to get into ModX so I can increase my skillset. I have done a fair amount of research on the topic, but ModX documentation seems a little ’minimal’ and tutorials very few.
I may therefore be doing something foolish which is making my situation more complex than it should be.
I am making a simple portfolio site. Under the main nav item "Design" (id 6) I want to show the first child of Design, and a paginated nav with "previous", "next" and "n of N" where n is the current page, and N is the total number of pages. I also want a subnav, listing all items under Design (id 6)
I have achieved this so far by creating a "Design" page which uses FirstChildRedirect to redirect to the first child.
I then use Wayfinder in the child pages in order to create the subnav. This is all working fairly well.
I then wanted to add pagination. I have found that Ditto, which I used the last time I played with ModX, some 3 years ago, is no longer the flavour of the month, and that I should be using getResource and getPage. I have installed both.
When I use the example given in the getPage page (
http://rtfm.modx.com/display/ADDON/getPage) I then get a list of all the items, using a template. However, there is no pagination navigation. Surely I should get the default?
[[!getPage? &element=`getResources` &parents=`6` &tpl=`myRowTpl`]]
<div class="pageNav">[[!+page.nav]]</div>
I have created chunks named "pagePrev" and "pageNext" which are a copy/paste from the default pagePrevTpl and pageNextTpl code, without the wrapping <li> tags.
How do I tell the pagination nav to show? How do I use my chunks (rather than the default)?
After reading on these forums about a similar problem I altered the "pageNav" div to read:
[[+page]] of [[+pageCount]] | [[!+page.nav]]
However, this shows text saying
1 of 1 |
This is incorrect in that there are more than 1 pages; and, the page.nav is not displayed.
Also, seeing as apparently getResources spits out a list of all the pages, is there any reason to use Wayfinder for the subnav? It seems that the list of child pages can be generated by getResources.
What I would really value would be a more complete tutorial/example than the limited help in RTFM - if anyone has a link to one, please let me know. If not - please suggest what I might be doing wrong.
Thanks