Is it possible to hide an umbraco item if it is empty?
I.e. on some pages this call <?UMBRACO_GETITEM field="secondaryText"/> returns nothing.
The div that it resides (SecondaryText) in has borders, but i dont want those borders to be show if there is nothing inside them.
I tried using jQuery like this:
Code:$(document).ready(function(){
if ( $("#SecondaryText").length < 1) {
$("#SecondaryText").hide();
}
});
But then it does not hide it when it's empty. Setting it to ".length <= 1" hides it properly, but it also hides every instance of the div that contains only 1 element.
So apparently, Umbraco returns an element to the webpage, even if its empty.
Anyone knows how to work aorund this?
www.eyecatch.no