6 users online. Create an account or sign in to join them.Users
DS to query distinct predefined Select box values
This is an open discussion with 7 replies, filed under General.
Search
I haven't used it myself but I believe that's what the Section Schemas extension does.
Thanks Nils: you're right. I remember looking into that extension before. I was hoping it would be easier with a simple custom DS.
Here's a quick solution for a custom ds:
- Create a datasource.
- Open the datasource file.
- Change function
allowEditorToParseto returnfalseinstead oftrue. - Find out the field id of the select box you're interested in.
- Add
public $fieldId = 19;(where 19 is the id) just below all the other properties at the top of the class. - Replace the
grabfunction with this one.
Hopefully, it will work.
Oooh @Alpacaaa that's exactly what I was looking for. Works a charm (I had to change the table_ prefix to sym_)!
Thanks a bazillion!
Awesome! Changing table prefix shouldn't be needed. It doesn't work using table_??
Nope, it had sym_fields_select but my table was called sym_fields_select.
That's true but symphony automatically replace table_ with the correct prefix you chose during install. Nothing important though, just to clarify :)
Create an account or sign in to comment.
I have a simple Select Box field with some pre-defined values (
one, two, three), say 'tags'. Authors can add one or more of these 'tag' values to an entry.What I'd like to have is an option to list the possible values on the front-end. So I need to have a DS that fetches all these predefined value options.
I could query all entries and filter them on distinct 'tag' values, but that seems a lot of work. Is there some way where I can create a simple custom DS that simply fetches my predefined value options for this field?