Replies: 20 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Then we're looking for the opposite handler, value |
Beta Was this translation helpful? Give feedback.
-
Hello guys, since I think this is currently supported |
Beta Was this translation helpful? Give feedback.
-
Did test myself |
Beta Was this translation helpful? Give feedback.
-
Just did the same test, I'm only getting the 'label' in this case, whether I use nothing or use {@simple_list, value} or use {@simple_list, not_existing_function}. However, in my case the Simple List had multiple selections. When I changed it to just one, I get the Value (though why not_existing_function should work makes absolutely no sense, whatsoever). So if 'value' is supposed to work, it's not being called when the display function in Pods Template is called against the Simple List Relationship when it has more than one record. |
Beta Was this translation helpful? Give feedback.
-
That actually makes sense. In the JoshPress.net http://joshpress.net/ On 30 August 2015 at 14:46, Jim True [email protected] wrote:
|
Beta Was this translation helpful? Give feedback.
-
Sounds like we need an 'actual' handler, then, correct? One that also properly processes if a list/array is passed to the value function. Most Simple Lists that have come through the forums are Multiple Selections, which is probably why this hasn't worked. |
Beta Was this translation helpful? Give feedback.
-
well this is a Design decision ^^ wether to change the default return for an array() to a comma seperated list or if to implement a pods_value() sort of function as it |
Beta Was this translation helpful? Give feedback.
-
is this feature still under development ? |
Beta Was this translation helpful? Give feedback.
-
Not currently being worked on, no. |
Beta Was this translation helpful? Give feedback.
-
Not that this is being worked on anyway, but it would be useful to get the label for any field, not just lists. |
Beta Was this translation helpful? Give feedback.
-
@Aetles That's a completely different request. Calling it a 'label' is the confusion. In Simple Custom Defined Lists, you enter a set of values that are input as "Label|Value". That's not the same as the "Label" for the field. If you would like to add an enhancement request for that, please create a new issue. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Ah, I see. Thanks for the clarification! |
Beta Was this translation helpful? Give feedback.
-
For additional clarification, we still need this, because we have no way to get the 'label' in an |
Beta Was this translation helpful? Give feedback.
-
FYI, When adding custom defined options for a field, the help text shows it to be swapped from what you said above, @jimtrue. The help says it should be value|Label. The Label is what is displayed to the user in radio buttons, checkboxes, and lists. The value is what is passed when submitting the form.
These are both working for me in an |
Beta Was this translation helpful? Give feedback.
-
@douglsmith Sorry just now replying on this one as I'd like to close it if it's actually supported.
How are you referencing these fields within an |
Beta Was this translation helpful? Give feedback.
-
I hope I wasn't talking about something different. Here's an example of what I was doing. I had a Supplies custom post type with several fields. One of those fields specified the color of the supply. That field was a simple custom defined list. I wanted the user to pick a simple color name like Red or Blue but I wanted to store the color's hex code to later display as a swatch on the screen. Here's the field definition … Which displays like this when editing a post … A Pod template then displayed the records like this. It set the title of a div to the user-friendly color name (the label), but set background-color in the style to the hex code (the value).
And that outputs something like this in the HTML for each record …
(Disclaimer for those who may stumble across this later: This was just for testing a while back and is not practical for very many color values. I've abandoned it in favor of separate color name and color picker fields. Those fields are then output as a title and color value, which changes the color of a cool looking SVG symbol.) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Stumbling upon here in 2020: has this been taken up any further? I have a pod with a field of type 'relationship', related to a 'simple (custom defined list)'. I allow for multiple (2) selections, and have the values come up through a magic tag. The options in the list have a value and a label like this: b-1-3|1/3 This displays fine in the pod list (as 1/3). But the magic tag returns the label, not the value. I've seen solutions suggested such as {@my-field,value}, and that works fine with a single selection, but not with multiple ones (as mentioned above). Any developments towards a solution? Thanks! |
Beta Was this translation helpful? Give feedback.
-
@maustyle @raoulunger |
Beta Was this translation helpful? Give feedback.
-
We should probably have a built-in display output filter that makes it easier for users to display either the label or value for Simple Custom Defined Lists in Pods Templates with the Magic Tags.
Default:
{@simple_list}
will always display the value; we need a{@simple_list,label}
. Might be useful for other fields as well.Beta Was this translation helpful? Give feedback.
All reactions