Share » Forums » General » How to get attribute value for a...

How to get attribute value for a current class

How to get attribute value for a current class

Saturday 14 March 2009 2:13:57 pm - 4 replies

Modified on Sunday 15 March 2009 4:06:11 am by Andrei Popa

Author Message

André R.

Sunday 15 March 2009 4:19:07 am

Why are you fetching the class and not the node?

{def $color_array = $node.data_map.color.content}
            {foreach $node.data_map.color.class_content.options as $option}
                {if $color_array|contains( $option.identifier )}<span>{$option.name|wash('xhtml')}</span>{/if}
            {/foreach}

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Andrei Popa

Sunday 15 March 2009 1:40:46 pm

Thanks for reply.

I tried your suggestion and is not work .

Very strange ... i tried to see in pagelayout.tpl in what is contain

{$node|attribute('show')}

and i get "Attribute Type Value".

I see that "$node" is not work in pagelayout.tpl

Any suggestion ?

What do I do?! What do I do?!?

André R.

Sunday 15 March 2009 2:38:08 pm

you need to fetch it first.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Andrei Popa

Sunday 15 March 2009 2:55:36 pm

I found the solution to get selected value from a selection (single selection) datatype.

{def $node=fetch( 'content', 'node', hash( 'node_id', $current_node_id ) )}
{$node.data_map.color.class_content.options[$node.data_map.color.data_text].name}

where $current_node_id = $module_result.path[$module_result.path|count|dec].node_id

Thank you very much for your help.
Andrei

What do I do?! What do I do?!?

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

36 542 Users on board!

Forums menu