I am using [[DisplayChildren]] in different sections of my site, and it works great. But is there a way to always keep a particular document at the top of the list? This could be done either within the snippet itself or in a separate call above it -- in the latter case, how would I go about calling the pagetitle and introtext for a document other than the present one? (I know how to use [~ID~] for links to other documents, but beyond that, I’m lost.)
Hope that’s clear enough -- help?!
Hi,
Not sure if [[DisplayChildren]] respects the menuindex flag of documents, but thats how it is supposed to be done
You can set the menu index for each document when you open it for editing in the manager.
Hope this is of some help.
Remon
Thanks for the tip. My (limited) understanding is that [[DisplayChildren]] sorts on the "createdon" field. This is good for blog-style date-based posting, but if I want direct control over sorting, I imaging I need to use the menu-index as a sort value. I would prefer if there were a kind of binary toggle that would select between placing documents in a "sticky" position or not -- the documents in each position could continue to be sorted separately by createdon. Anyone have thoughts on this? And practical implementation (my coding skills are limited)?
-
☆ A M B ☆
- 24,524 Posts
Where is this "DisplayChildren" snippet? The core function getDocumentChildren allows you to pass an argument as to which field you want to sort by, so the snippet should easily be able to do the same. I’d like to take a look at its code.
The DisplayChildren snippet was written for Etomite and (AFAIK) still resides in their snippet library.
-
MODX Staff
- 12,272 Posts
Isn’t the request kinda the same as DropMenu with a level limit of 1?
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me