don't show tags if empty

mondo
mondo
Offline
0
currently there's only the option yes/no to show tags, but I want this field to be hidden if empty.

! added value="2">Show only if not empty in config xml
and in albums/default.php:
<?php if($this->params->get('showalbum_tags', 1) == 1 || ($this->params->get('showalbum_tags', 1) == 2 && $this->album->tags)){ ?>


It still shows the label 'Tags'.
What am I missing here?

Thanks,
mondo
Responses (3)
  • Accepted Answer

    Friday, February 19 2016, 07:05 PM - #Permalink
    0
    well, your "if" has to go before the word "tags" to avoid showing it.. I guess that's it...
    The reply is currently minimized Show
  • Accepted Answer

    mondo
    mondo
    Offline
    Saturday, February 20 2016, 05:21 AM - #Permalink
    0
    thanks. I did that correctly. The params are stored as well in #__extensions.
    Still no luck. Only yes/no option works.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, February 22 2016, 06:12 PM - #Permalink
    0
    well, yes, sorry about this. I didn't think (before answering) that the Tags field is not just a string, so the comparison you're using won't work...
    you need to evaluate at least if the album tags (which is an ARRAY) is not empty

    try using the empty() function
    The reply is currently minimized Show
Your Reply