I have a template variable called rank, its a rank from 1 to 10 and would like to sort my results by it.
Can someone give me an example or if its poss.
Many thanks.
Simon
My call so far is
[[Ditto? &tpl=`DittoTemplate` &startID=`3` &summarize=`40` &tagData=`tvcategory` &tags=`Shopping` &sortby=`tvrank` &sortDir=`DESC`]]
I just need someone to point me in the right direction, the sorDir is working but the &sortby=`tvrank` is doing nothing for the sorting order values of 1 to 10
That call should be working. You are using Ditto 1.1 Beta right?
I`m using 1.02, its not sorting on the number its soring on the creation date I think or something else I have 2 records and when I give them a value of 10 and a value of 1 or vice versa they always come up in the same order, it only changes if I put ASC and then if I change the template variable to 1 or 10 and vice versa they always come up the same
Where can I download version 1.1 beta? is this the same as 1.02?
Is there anyway I can see or test that the tv is getting passed to the ditto call?
It is in a thread in the snippets in development forum. The way it runs is fundamentally different from Ditto 1.0.2 but everything you see should look the same. You can see variables being passed by appending &debug=`1` to the snippet call.
I dont really want to use the beta for the plugin, I added the debug call is
[[Ditto? &tpl=`DittoTemplate` &startID=`3` &summarize=`40` &tagData=`tvcategory` &tags=`Shopping` &sortby=`tvrank` &debug=`1`]]
Number supposed to be summarized (summarize): 40
Total supposed to be returned: 2
Count of total in db: 2
Sort by (sortBy): createdon
Sort direction (sortDir): DESC
Using the new MODx 0.9.2.1 API
TVs: name, rank, affiliatelink, logo, descriptiontext, category
Start at 0 and stop at 2 out of 2
If you look at the sortby its sorting on createdon?
Hi,
I could be totally wrong, if so my apologises.
But looking at your snippet call it seems to me you made a typo for &sortBy param
[[Ditto? &tpl=`DittoTemplate` &startID=`3` &summarize=`40` &tagData=`tvcategory` &tags=`Shopping` &sortby=`tvrank` &debug=`1`]]
:-)
yea I just noticed that myself now without the typo it returns nothing at all! and it ignores the &debug so I cant see whats going on
thanks for the help tho
Ah it says in the docs it reverts back to sortedon if the value is not valid, I thought this version could filter on tv?
In the download for ditto is says Extensive sorting and filtering based on TVs, but I couldnt find any examples?
I wish I could figure out whats wrong.
Also when I try and pass &sortBy=`tvrank` the debug info stops working