As far as I remember the content of an ezselection is stored in data_test to allow for multiple selects so you might try that. According to the documentation for selection, 'The ".content" of an ezcontentobjectattribute object using this datatype returns an array of the identification numbers (as strings) of the selected options.' So another idea might be to just check for $attribute.content which should be an empty array if nothing is selected.
Just count the elements - if the count is zero the array is empty.
{def $foo = array()}
{if $foo|count()|eq(0)}
the array is empty
{else}
the array is not empty
{/if}
Actually most of the if condition is not strictly necessary:
{if $foo} should evaluate to true if the array contains something and to false otherwise
{if $foo|count()} should evaluate to true if the array contains something and to false otherwise but as this is not clearly mentioned in the documentation (or I have not found it), I would not rely on such shortcuts.
Sorry, I had totally forgotten that an ezselection without anything selected still returns an array with one entry (whose value is an empty string).
Seeing this, you either should use data_text or sort_key_string for your show condition. If you want to use the content of the attribute you have to check whether the first array entry is an empty string or contains a number. I don't know which method is better so just use the one you like most.
Claudia
You must be logged in to post messages in this topic!