Again with experimenting with NewsListing.
So far I have used the &filter parameter without a problem, but on this new project I have it’s not working and I am really getting frustrated trying to understand what is wrong...
Here is my case : I am building a directory of employees, each of them have a page with defined TVs (name, job, skills, phone number, email...) grouped in a folder, which I want sorted alphabetically and by skills.
I tried to make the same call with
&sortby=`tvnom` &sortdir=`desc` but
the snippet doesn’t seem to support bortig by TV (does it ?).
But the main problem I have is the sorting by skills.
It simply output nothing where it should do so (or at least, it did in my previous projects...) :
Snippet Call :
<h2 id="droit_famille_succession">Droit de la famille et successoral</h2>
<ul>[!NewsListing? &startID=`72` &tpl=`fiche_service` &summarize=`200` &emptytext=`Pas de collaborateur dans cette spécialité` &filter=`tvspecialite,Droit de la famille et successoral,1` &hiddentv=`specialite`!]</ul>
TPL Chunk :
<div id="fiche">
<h3><a href="[~[+id+]~]" title="Consulter la fiche de [+tvprenom+] [+tvnom+]">[+tvnom+], [+tvprenom+]</a> - [+tvfonction+]</h3>
<p>[+tvemail+] | [+tvtel+]</p>
</div>
The TV used to filter is a checkbox.
I checked by changing the values, it’s not the spaces in my TV’s values. I also checked that the fact this TV could have multiple values did not interfere with the filter => checked only one value on some items and ran the snippet. I also went in the database with phpMyAdmin to see how multiple values were stored => It’s value2||value5.
If I pass &filter=`tvmytv,value2,1` into the snippet while the item’s TV has two checkbox checked : value2 and value5, will it return something, given that mytv’s value is value2||value5 ?
Maybe that’s what’s going wrong there ?
Please bear with me, might be obvious but I am getting nowhere with this...