Hi, I’m trying to find a way to sort getResources in whatever order they appear in the tree menu, as they function for the menu. I want the editor to be able to control which element appears first on the home page, and this seems like the best solution, if possible without too much hassle. Alternatively I could use a tv dropdown/radio that gets the number of elements within a resource and lets the order be chosen that way, but being able to simply re-order would be so nice!
Any ideas on this? The help page doesn’t mention what can be used for sortby.
Right. When you drag things around in the tree, the menuindex numbers are rewritten accordingly.
If you change the tree to sort it on some other field (e.g., pagetitle, createdon, publishedon, it doesn’t change the menuindex numbers *unless you drag something into another position* -- then it does.
If you always sort by menuindex, you can just design your menu in the tree by clicking and dragging.
Great, that is good to know. What threw me off at first was that I was expecting the sort order to be ascending by default for some reason, so when the 2nd of my two items was on top, I thought it wasn’t working. Man, I feel like a whole new world of possibilities is opening up now that I’m learning how to use getResources with chunks with placeholders in them.