Forums / Developer / Selection attribute ..has_content?

Selection attribute ..has_content?

Author Message

Lo' F.

Tuesday 29 March 2011 3:32:00 pm

Hi there,

I need to display the content of the attributes of a class only if they have some content.

Like for a text field it can be achieved this way..

{if $node.data_map.xxx.has_content}...

How can I check if a selection attribute has content or not?

The first option of the selection attribute is left empty, while the others have some values. If that is the one selected then what's inside the condition doesn't have to be showed.

loredanaebook.it

Gabriel Finkelstein

Tuesday 29 March 2011 8:01:02 pm

A selection attribute has always content. What you can do is check if that content is empty, like this:

{if $node.data_map.xxx.content.0}...

Lo' F.

Wednesday 30 March 2011 2:22:25 am

"

A selection attribute has always content. What you can do is check if that content is empty, like this:

{if $node.data_map.xxx.content.0}...
"

Gabriel, thank you so much!

loredanaebook.it