Maybe you’re JSON is wrong, try: &where= {"SelectedStartupTV":"oui"}. Also, check if you set the radio naming correctly. It can also be that SelectedStartupTV’s value is not “oui” but “on”.
Also, an old post suggested that pdoResources doesn’t handle TVs set to their default value properly. I don’t know if this is still true, but if it is, and the TV has a default value of ‘oui’ or ‘non’ that could be your problem.
The underlying reason is that TVs set to their default value have no record in the table that holds the TV values for specific resources, which is where pdoResources looks (or used to look) for the values.
One solution would be to switch to getResources and use its &tvFilters property.
i understand the tricks with default value, it’s one of the first thing i do: go to every ressource change value and save and rechange value a second time just in case.
this one give me result i dont want &where=`{"OldStartupTV.value:=":"oui"}`
and this one give me nothing &where=`{"OldStartupTV.value:=":"non"}`
i dont like to missanderstood something like this but i have nor competance nor time to go further, Thanks to every one for dedicated help. i will stick with getressources for this one
I think you shouldn’t give up yet.
Let me see if I can somehow help.
I use pdoTools for everything I code with Modx and it is a great extra. Never found anything that was not working properly.
Some hints from my side:
We would need to know how your TV details, but I would suggest that the TV is a List Box (Single-Select) withh input option values of: Oui==1||Non==0
Output type of the TV should be Text
Then try to edit a value for this TV, save the resource and check on the Database directly how it is being stored on the table modx_site_tmplvar_contentvalues. The ‘value’ field is from where you should guide your query filter.
Then on your pdoResources call, you need to filter like this:
&where=`{"OldStartupTV":"1"}`
Omitting the operator is the same as stating OldStartupTV=1
I have several situation having exatly this same scenario.
Please ping me if you need help.
I will try Oui==1||Non==0
fact is, i dont remember it was a possibility (even i’ts tagged in gray under tv property)
I use modx for a time now but i dont crawl database too much, after a quick search on modx_site_tmplvar_contentvalues it content only oui value (why?).
i will give a try on those thing today but i need to change the type of my tv (client change) so may be no more radio button but a drop down list.
maybe some news in few hours.
Thanks all to improving my knowledge on modx,
… after a quick search on modx_site_tmplvar_contentvalues it content only oui value (why?).
In that table each record only stores the one selected option of that TV for one specific resource. (Nothing is stored in that table if the TV is set to its default value.)
The full list of options is in the properties field in the TV object table (modx_site_tmplvars).
I make it work ! Oui==1||Non==0 for checkbox Non selectionné==1||Séléctionné==2||Inscrite à l'émission==3||En finale==4||Archivée==5 for a single selection list and it work with this style of code for pdoressources :
and i even make my first snippet to retrieve the name of selected item of the list ! :
Status : [[+tv.StartupStateTV:StartupStatus]]
and the StartupStatus snippet
<?php
$input = isset($input) ? $input : "";
if ($input == "") return "";
else
{
switch ($input)
{
case ("01") : $statustxt = "Non selectionné"; break;
case ("02") : $statustxt = "Séléctionné"; break;
case ("03") : $statustxt = "Inscrite à l'émission"; break;
case ("04") : $statustxt = "En finale"; break;
case ("05") : $statustxt = "Archivée"; break;
}
return "$statustxt";
}
i need to change the name of this snippet in ‘showstatus’ to be clear enough but that work.
Thanks all for the help.
i really need to make more web dev project to improve my skill in modx !
the more I dig, the more interesting things I find