<![CDATA[ Wayfinder Sort Options - My Forums]]> https://forums.modx.com/thread/?thread=39467 <![CDATA[Re: Wayfinder Sort Options]]> https://forums.modx.com/thread/39467/wayfinder-sort-options?page=2#dis-post-549804 Quote from: the-city at Mar 31, 2017, 01:29 PM
It can be done
if (!empty($this->_config['contexts'])) {
$c->where(array('modResource.context_key:IN' => explode(',',$this->_config['contexts'])));
//$c->sortby('context_key','DESC');
}

You can change the Wayfinder snippet
(in core/components/wayfinder/wayfinder.class.php)
For those who are searching
Line 545 in Wayfinder-2.3.3-pl]]>
the-city Mar 31, 2017, 01:31 PM https://forums.modx.com/thread/39467/wayfinder-sort-options?page=2#dis-post-549804
<![CDATA[Re: Wayfinder Sort Options]]> https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-549803 It can be done
if (!empty($this->_config['contexts'])) {
$c->where(array('modResource.context_key:IN' => explode(',',$this->_config['contexts'])));
//$c->sortby('context_key','DESC');
}

You can change the Wayfinder snippet
(in core/components/wayfinder/wayfinder.class.php)
For those who are searching]]>
the-city Mar 31, 2017, 01:29 PM https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-549803
<![CDATA[Re: Wayfinder Sort Options]]> https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228466
I can call wayfinder with the &startId= targeting my new group of weblinks. And I have the freedom to rearrange the weblinks using the menu index numbers.]]>
Designer1337 Dec 22, 2009, 07:48 PM https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228466
<![CDATA[Re: Wayfinder Sort Options]]> https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228465 ]]> pbowyer Sep 28, 2009, 02:48 AM https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228465 <![CDATA[Re: Wayfinder Sort Options]]> https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228464 Quote from: goldsky at Sep 16, 2009, 01:34 AM

Or, just keep the default &sortBy setting, you can manage the menuindex order with Doc Manager.

He wants to sort two menus, basically made up of the same documents but using two different criteria. If he were to alter the menuindex both menus would be affected and would look the same. He wanted a custom sort for the second menu in a way which did not lend itself to an alphabetical listing criteria.

cheers/k]]>
kongondo Sep 16, 2009, 02:12 AM https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228464
<![CDATA[Re: Wayfinder Sort Options]]> https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228463 goldsky Sep 15, 2009, 08:34 PM https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228463 <![CDATA[Re: Wayfinder Sort Options]]> https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228462

All the best with your project!

cheers/k]]>
kongondo Sep 15, 2009, 04:09 PM https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228462
<![CDATA[Re: Wayfinder Sort Options]]> https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228461
Man I’m sorry for the double or triple post I lost track of where I posted. This is a fine solution and I think will work for what I need done. Again sorry for all the posts Cheers!

Matt]]>
TikaL13 Sep 15, 2009, 04:08 PM https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228461
<![CDATA[Re: Wayfinder Sort Options]]> https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228460
Please don’t double post, thx.

So, the Home page menu looks like:

home | about | contact us | programs

And you want the interior pages one look like:

home | programs | about | contact us

is that correct? I don’t think it is possible unless you use some "trickery"

The &sortBy parameter allows you to sort using any of the following...


[ id | menutitle | pagetitle | introtext | menuindex | published | hidemenu | parent | isfolder | description | alias | longtitle | type | template | random ]

So, for the home page menu, you can probably sort by menuindex.

Then for the interior pages, you can sort by another field. Some form of alphabetical sorting will not work for you because the output you want for this menu is not alphabetical. So, you are left with either (i) using the "id" as the sort criteria - but you probably don’t have control over the ids assigned to the docs by MODx. So, and here comes the trickery, you could use the description document field to do your sorting. But, you would have to make sure these are in the order you want. So, maybe, in the description fields for the respective docs:

Page Title
Description (field)

home 1_home
programs 2_programs
about 3_about
contact us 4_contact us

First WF call add &sortBy=`menuindex` make sure you assign menu indexes correctly
Second WF call add &sortBy=`description`

Now, this is not elegant but I can’t think of any other way to achieve what you want...or maybe am just tired and cannot think straight grin

cheers/k


]]>
kongondo Sep 15, 2009, 03:56 PM https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228460
<![CDATA[Re: Wayfinder Sort Options]]> https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228459
They both are using &startid=`0`.

Now the second interior menu is currently in this order:
home | about | contact us | programs

I would like to have this menu in a custom sort like so:

home | programs | about | contact us

Now it’s emulating the doc tree which is fine because the docs are in the correct order for the menu on the home page to feed off of.

The interior menu has also a &includedocs=`` call which allowed me to filter out other menu items but now I would like them sorted like the example i gave.

I just need to know if this is possible?


Thanks,

Matt


]]>
TikaL13 Sep 15, 2009, 01:52 PM https://forums.modx.com/thread/39467/wayfinder-sort-options#dis-post-228459