Hi everyone and the best for 2017 !
I've a MM list to display a list of peoples in FE. I'm feeling stupid to ask it but I don't find how to let visitors choose the sorting : by name or by zipcode for example.
Thanks for this first help of 2017 ;-))
Printable View
Hi everyone and the best for 2017 !
I've a MM list to display a list of peoples in FE. I'm feeling stupid to ask it but I don't find how to let visitors choose the sorting : by name or by zipcode for example.
Thanks for this first help of 2017 ;-))
Hi,
you should have a select field at CE-MM-List or FE-Module MM-List to sort your items e.g. name or zip as default...
as add you can activate "Allow sort override" to change the sorting per get parameter.
Pls look at
http://metamodels.readthedocs.io/en/...ptions-ce-list
[Thx at Almut for the translation!]
Ok. I'll see it. I haven't yet translated this page of Almut's translation ;-))
ok. Got it.
So do I have to create manually two links or is it possible to integrate them in the CE_MM_list as a select button for example ?
I add links manualy at template e.g. in the header of a table
you can see this at https://www.vhw-hamburg.de/wohnen/ak...-angebote.html
Ok. And how do you manage the switch between ASC and DESC ?
some lines as example
PHP Code:...
$strCurrentOrderDir = strtoupper(\Input::get('orderDir'));
...
$strToggleOrderDir = $strCurrentOrderDir == 'ASC' ? 'DESC' : 'ASC';
...
$strHeadline = '<a href="'.\Frontend::addToUrl(...&orderDir='.$strToggleOrderDir.').'">My Headline</a>';
Ok but before trying to use toggle, I still have a problem with the former part of the answer…
I have a filter module just before the list with a select list for departments (like '01 - Ain', '06 - Alpes maritimes'...) and a tag filter for specialities.
So, when I first load the page, the url is : http://eefic-v3-b:8888/sitev3-B3/trouver-expert.html
If I select the department '06 - Alpes maritimes', the url becomes : http://eefic-v3-b:8888/sitev3-B3/tro...Maritimes.html
Then I can manually add '/orderby/nom_expert/orderDir/ASC' to the url and it works : http://eefic-v3-b:8888/sitev3-B3/tro...erDir/ASC.html
But how can I add it just before the .html in the actual url from my link ?
I've tried with insert tags {{env::path}}, {{env::request}} and {{env::referrer}} but I don't find the solution. Does it absolutely need some php ?
to use the PHP with "Frontend::addToUrl" is the best way in my mind - as alternative, you can try javascript...
http://code.contaowiki.org/api/class.../addToUrl.html
Ok. I tried but I'm very bad at PHP. So, do not speak more about switch… Just what should be my php code(s) for I need two links :
- one for orderBy/nom_expert/orderDir/ASC
- and the other orderBy/zip_expert/orderDir/ASC
(and I suppose orderDir/ASC is optional as it is the default behavior).
-- I (we) clearly miss an option in BE (or a sort module) where we could choose many sorting as we can do for input screen. I could suggest it on github ?--
I answer to myself :For info : if I usePHP Code:<a href=" <?php echo $this->addToUrl('orderBy=nom_expert&orderDir=ASC'); ?>">ASC</a>
as indicated in the doc, I got a loop.PHP Code:<a href=" <?php echo $this->redirect($this->addToUrl('orderBy=nom_expert&orderDir=ASC')); ?>">ASC</a>