I’ve hardcoded the prev/next links from pagetitle to menutitle, but would be great if this was configurable from a parameter standpoint.
Also, noticed the following code on line 159:
$children = $etomite->getActiveChildren($parentid, $sortBy, $sortHow, $fields);
I’m assuming that $etomite should be $modx.
|
Identity Developments delivers SEO focused web design and web presence services
- it's not about websites, it's about your identity. |
oops, I mean documents with the "hide menu" option... not unpublished documents...
Is there any way to include children in PrevJumpNext? I have some complex documents arranged in an outline hierarchy, eg., 1, 2, 3, 3.1, 3.1.1, 3.1.2, 3.1.3, 3.2, 3.2.1, 3.2.2, 4, 5 . . .
Since PrevJumpNext only looks at siblings by default, I cannot get it to include the children when the children are next or return to the Aunts and Uncles when the children are finished. For now, I’m using placeholders on each document and replacing them with custom <Prev and Next> when the flow changes levels; it’s a time consuming, arduous task for these large documents. Otherwise, PrevJumpNext does exactly what I need. Thanks - John
Oops! this is more of a problem than I thought. I roll up all the small pages of the large document into one long document using Ditto. After spending hours doing custom <Prev and Next> tags, I realized those were showing up in the one page version whereas the placeholder output of the PrevJumpNext snippet were not. So, I’m really stuck until someone shows me how to include children in the snippet call.
I wouldn’t mind adapting it myself but I am completely ignorant of PHP. I see there is a call to the MODx method GetActiveChildren but there is little documentation on it. I do not know if it has an option to get descendants. I also see a GetActiveDescendants call but there is no documentation on it.
Sorry to be such a pain. I really do appreciate this snippet; I’m just dead in the water until I get an answer. Thanks - John
-
☆ A M B ☆
- 54 Posts
Hi there!
Add 4 lines in the PrevJumpNext snippet:
After
$limit = count($children);
add
$PJN_totalPlaceHolder = $limit;
After
$current=$y;
add
$PJN_currentPlaceHolder = $current;
Add
$modx->setPlaceholder(’PJN_total’,"<span class=’PJN_Menu’><span class=’PJN_Total’>".$PJN_totalPlaceHolder."</span></span>");
$modx->setPlaceholder(’PJN_current’,"<span class=’PJN_Menu’><span class=’PJN_Current’>".$PJN_currentPlaceHolder."</span></span>");
This adds the possibility to show "Showing document 4 of 20" by using "Showing document [+PJN_current+] of [+PJN_total+]" in your template.
Greetings
Lars
Thank you very much, Lars. But perhaps I misunderstand. How will these additions help me navigate through the children? Thanks - John