eZ Community » Forums » Developer » assign value from attribute_view_gui...
expandshrink

assign value from attribute_view_gui from select attribute

assign value from attribute_view_gui from select attribute

Tuesday 08 September 2015 10:40:26 am - 1 reply

I have an attribute if type `select`. When i try to get value from this attribute content it gives the identification number instead of the value. I call like $node.data_map.my_attribute_identifier.contentThis is expected behaviour. https://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Datatypes/Selection

 

> Raw outputThe ".content" of an ezcontentobjectattribute object using this datatype returns an array of the identification numbers (as strings) of the selected options.

 

I want the value not the identification number. I can get that using `attribute_view_gui` like attribute_view_gui attribute=$node.data_map.my_attribute_identifier

 

But i can't assign value to a variable this way. How can i assign value from a `select` attribute?

Modified on Tuesday 08 September 2015 10:41:53 am by akhtar zaman

Tuesday 08 September 2015 6:01:15 pm

Look at /content/datatype/view/ezselection.tpl and use the {set-block} template operator.

Then, just use the {$my_var_name} variable

Another example: 

Modified on Tuesday 08 September 2015 6:07:17 pm by Vincent GUYARD

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from