Comments (10)
Just specify &sortby=``
from pdotools.
That may work if I am sorting by a field, but it does not work if I need to sort them in the exact order that I specify in my call in the snippet. How do I get them in this exact order?
99,748,443,1086
I can't sort by id. I can't sort by pagetitle. I can't sort by longtitle. What do I sort by?
from pdotools.
You do not understand me. You need specify not empty &resources and empty &sortby.
[[!pdoMenu?
&parents=`0`
&resources=`1,2,25,68`
&sortby=``
&showLog=`1`
]]
http://yadi.sk/d/P4doJMcgK6JnF
from pdotools.
hm, could it be that your example works "as expected" as your resources are basically in the order they would be anyways (eg. ASC ids)? I remember that disussion: https://github.com/bezumkin/pdoTools/issues/26
where the outcome was
&sortby=`FIELD(modResource.id, "392,230,538,476,210,530,110,209,118,84,228,229")`
from pdotools.
exside: my resources were almost in the order of ascending IDs, but one of them was out of place.
bezumkin: Yes, sortby=`` (empty value between the backticks) did work. Thank you.
I would not have expected that to be the method though. I would have expected the default order to be the order that I specified in the &resources parameter. Wayfinder uses that order. Now that I know how it works, I can do it, but it would be more intuitive to use the order I specified without having to also specify an empty sort string.
from pdotools.
pdoMenu already has default sort by menuindex, that is why you need to specify empty &sortby
And you can continue using more intuitive Wayfinder, if you like it.
from pdotools.
pdoMenu is much faster than Wayfinder. I stopped using Wayfinder as soon as I found pdoMenu. I don't mean to say that I prefer Wayfinder, because I don't. Your software is better. And I agree that menuindex is the best field for the default sort order. Wayfinder does that too. In the specific instance of specifying exact IDs, though, Wayfinder will use the order I list them, without having to specify a separate parameter for the sort order. When specifying exact IDs, the IDs might be in several different containers/folders, so the menuindex is not a reliable method of sorting. Menuindex is reliable only when the items are in the same container/folder.
from pdotools.
pdoMenu is based on pdoTools library, that has many features.
You can specify the only needed ids of resources in query, but sort them by publishedon field, or menuindex. Why I need to force your sorting decision?
The same rules works in pdoResources and other snippets - thanks to pdoTools.
from pdotools.
In additional testing, I've discovered that pdoMenu still does not order the menu items in the exact order that I need. If I have resources at different levels in the hierarchy, even if I use sortby=, pdoMenu seems to put all of the items at the top level first, then all of the items at the second level. So in this statement: [[pdoMenu? &parents=`0` &resources=`1,20,2,21` &sortby=
]]
If 1 and 2 are at the top level, and 20 and 21 are at the second level, pdoMenu will display them in this order:
1,2,20,21
If I move resource 20 to the top level, then the pdoMenu will give me this order:
1,20,2,21
But I cannot get the desired order if 20 is on level 2.
from pdotools.
did you try
&sortby=`FIELD(modResource.id, "1,20,2,21")`
?
from pdotools.
Related Issues (20)
- pdoPage: Undefined variable $showLog HOT 3
- (ERROR @ /home/s30946/www/core/components/pdotools/model/pdotools/pdotools.class.php : 999) Unexpected token 'match' in expression
- MODX Revolution 3.0.2 + pdoTools 3.0.1 / showLog doesn't work
- &outputSeparator + ajax technology don't work correctly
- Fatal error при включенной опции pdotools_fenom_cache
- issue with pdoPage snippet of pdoTools component
- [Fenom] Не корректно работает $.tpl.name HOT 7
- Return an array of raw data (it is necessary when using the Fenom template engine). HOT 1
- includeContent doesn't work when not logged in [pdoResources]
- pdoCrumbs issue
- pdoResources ломается, если нет поля для сортировки
- pdoMenu - active class not set correctly with weblinks
- Incorrect Friendly URLs with pagination when using pdoPage
- The showLog change has to be documented somewhere
- Bug PHP 8 pdoResources snippet with property 'toSeparatePlaceholders' in combination with pdoPage HOT 1
- Добавить параметр &limitOnPage для pdoPage
- pdoMenu не возвращает данные по параметрам
- Fatal error: Allowed memory
- >=php 8.3 - decrement on type null
- Static Plugins trigger pdoToolsOnFenomInit even if not defined as their Event
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdotools.