Topic: SOS: How do I display content of &parents=[*id*] dynamically?  (Read 1073 times)

Pages: [1]   Go Down

#1: 11-Oct-2007, 12:50 PM

bne_aus
Posts: 12

I am trying to display the content of a non-container document that Ditto is called from dynamically (&parents=`[*id*]`). Basically, the idea is to have some documents that would have children which would be paginated, and some documents in the same parent folder without child docs, only with own content which I want to display as well.

Ditto Call
Code:
[!Ditto? &parents=`[*id*]` &summarize=`1`  &tpl=`paginate_content` &paginateAlwaysShowLinks=`1`  &paginate=`1` &sortBy=`createdon` &sortDir=`ASC` ]

paginate_content Chunk
Code:
<h3>[+pagetitle+]</h3>
[+content+]
<br><br>
<div id="ditto_pages"> [+previous+] [+pages+] [+next+] Page <strong>[+currentPage+]</strong> of <strong>[+totalPages+]</strong></div>

With the above code I get "No documents found." if the document has no children.

I even tried &emptyText=`[+content+]` but that didn't work.

I don't simply use [*#content*] instead of Ditto because I need pagination.

I guess there should be a simple solution to this, but I couldn't find it for the last 6 hours on the forum, in the documentation or wiki.

Please help me before I get brain damage.
« Last Edit: 11-Oct-2007, 01:33 PM by bne_aus »

#2: 11-Oct-2007, 04:12 PM

Testers

dev_cw
Posts: 4,179

WWW
I cant help with this in ditto, but there is a snippet that handles pagination that I have used, PrevJumpNext. It only works within containers so I am not sure this helps.

http://www.modxcms.com/PrevJumpNext-831.html
Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

Something is happening here, but you don't know what it is.
Do you, Mr. Jones?  -  [bob dylan]

#3: 11-Oct-2007, 05:06 PM

bne_aus
Posts: 12

Thanks, It's a nice snippet, but it doesn't allow to paginate based on number of child pages. Maybe I should just paginate based on a number of characters in the document until I solve this one.

#4: 11-Oct-2007, 10:11 PM

Testers

dev_cw
Posts: 4,179

WWW
OK, how about the splitPagination snippet:
http://modxcms.com/1465

With a discussion here:
http://modxcms.com/forums/index.php/topic,14008.msg91691.html#msg91691
Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

Something is happening here, but you don't know what it is.
Do you, Mr. Jones?  -  [bob dylan]

#5: 12-Oct-2007, 01:58 AM

bne_aus
Posts: 12

This snippet is just a different version of [+pages+]. I want to try to do it with Wayfinder.

#6: 12-Oct-2007, 05:02 PM

bne_aus
Posts: 12

Why wouldn't Ditto display the content of the document it is called from?

#7: 12-Oct-2007, 05:05 PM

bne_aus
Posts: 12

Знает кто-нибудь салюшин?

#8: 14-Oct-2007, 08:48 AM

bne_aus
Posts: 12

I ended up using Pagination Plugin 1.0.0 by bS, but if you use it, make sure you delete <?php in the begging of the plugin code and make the page you use it on uncacheble.
Pages: [1]   Go Up
0 Members and 1 Guest are viewing this topic.