Hi all. Straight to the question - can such kind of pagination be made with Ditto:
[1][2][3][4][5] ... [34][35][36]
?
I mean, links in between are hidden and shown only then your’re on pages near to them. By default, all pages are shown. Solutions like limiting # of pages (&total) or creating an archive not good for me.
"Sorry for my english"
This snippet outputs links even better than I wanted to =) Thank you Mark!
There was a little trouble with making snippet work - links wasn’t splitted with such call:
[[Ditto? &summarize=`3` &total=`77` &parents=`61,64,66,67,47` &depth=`5` &hideFolders=`1` &tpl=`np` &tplAlt=`npalt` &tplFirst=`npfirst` &paginateAlwaysShowLinks=`1` &extenders=`summary` &truncLen=`500` &truncOffset=`100` &truncText=`Читать далее...` &paginate=`1` &dateFormat=`%B %d %Y, %H:%M` &tplTrunc=`ditto_readmore` &hiddenFields=`news_source`]]
[[splitPagination]]
Cached and uncached, different settings for total and summarize were used. So I’ve change [+pages+] to [[splitPagination]] in my template, and modify last snippet string: "if ($return) return $ph;" to just "return $ph;".
Maybe it’s not a correct way and i’m missing smth, but it working and me is happy :]
"Sorry for my english"
The snippet above sets [+splitPages+] for you to use instead of [+pages+]. If you call it with &return=`1` it will return the value back to you instead of placing the output in a placeholder. Remember, never call pagination calls cached unless the page is uncached.
Thanks for clearing things. I think this snippet could be listed in repository or embedded in ditto.
"Sorry for my english"
So will it read the splitter marker and make pages?
Can I show section names instead of pages?
Thanks,
Gary
[Edit] Removed quote for readability
This snippet is just a different version of [+pages+]. What do you mean by show section names?
Ok. I’m not understanding the execution of this snippet. Can someone help me. I have the following in a document
[!Ditto? &parents=`46` &summarize=`10` &total=`20` &commentsChunk=`blog_CommentsBlog` &tpl=`blog_BlogTemplate` &dateSource=`pub_date` &dateFormat=`%m-%d-%Y` &sortBy=`pub_date` &paginate=`1` &paginateAlwaysShowLinks=`1` !]
[!splitPagination!]
I’m expecting a 2 page notification at the end of a list of 10 entries but it’s doing nothing. What am I doing wrong?
Thanks,
gl330k
I have about 4000 docs to output with Ditto, so this snippet is the only way I can do pagination with (the usual [+pages+] simply won’t fit into screen). But splitPagination behave somewhat strange... it adds an extra page at start ([1][1][2][3]...) and the active page won’t turn into <span>, so we do not see the active page actually. Here is the page with my case:
http://s31183.gridserver.com/news
Please help me with that... its kind of crucial for me
Thanks in advance.