Exclude search in template if the attribute is empty