Jump to content

RicknRoller
 Share

Recommended Posts

In the Doc it says:

Quote

Separate Option Values

By default only titles are kept with each option. If you want to maintain a separate value and title, enter your option in the format value|title (for new options) or 123=value|title (for existing options that already have an ID assigned). The text for value and title will be kept as separate $option->value and $option->titleproperties from the API. These properties can also be independently queried to find pages from the API.

I have an options field (options_colors) configured like this:

Quote

1=red|number1
2=blue|number2
4=green|number4
5=grey|number5
6=beige|number6

I want to have a query returning only pages with the VALUE 'red'. This is a query that works:

$newsentries = $pages->find('template=news-entry,options_colors=number1,sort=-created,limit=16');

this is a query which does not work

$newsentries = $pages->find('template=news-entry,options_colors=red,sort=-created,limit=16');

How do I query for 'red' instead of the title for the value?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...