Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gary 40 posts 129 karma points
    Aug 02, 2013 @ 11:57
    Gary
    0

    Only show content if tags > 0

    Hello,

    I have a group of tags sitting in a styled div using this code

    <xsl:if test="($currentPage/descendant-or-self::*/parent::*[@isDoc and @parentID='4253'])">
        <div class="ssnSubNode"><strong>Tag Group Title</strong></div>
        <ul>
            <xsl:for-each select="tagsLib:getAllTagsInGroup('tagGroup1')//tag">
                <li style="padding:7px 0 0 10px;"><a href="?tag={.}"><xsl:value-of select="."/></a> (<xsl:value-of select="@nodesTagged"/>)</li>
            </xsl:for-each>
        </ul><br />
    </xsl:if>
    

    Can anyone give me guidance on how i can hide all of the above if there is no tags?

    Many thanks,

    Gary

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Aug 02, 2013 @ 12:14
    Dennis Aaen
    0

    Hi Gary,

    I must say this is a shot in the dark because I don´t have worked with the tagsLib:getAllTagsInGroup  before, but I want to try to help you anyway.

     

    <xsl:iftest="$currentPage/descendant-or-self::*/parent::*[@isDoc and @parentID='4253'])">
       
    <xsl:iftest="count(tagsLib:getAllTagsInGroup('tagGroup1')//tag) > 0">

       
    <divclass="ssnSubNode"><strong>Tag Group Title</strong></div>
       
    <ul>
           
    <xsl:for-eachselect="tagsLib:getAllTagsInGroup('tagGroup1')//tag">
               
    <listyle="padding:7px0010px;">
                 
    <ahref="?tag={.}"><xsl:value-ofselect="."/></a> (<xsl:value-of select="@nodesTagged"/)          
               
    </li>
           
    </xsl:for-each>
       
    </ul><br/>
    </xsl:if>
     
    </xsl:if>

    But as I said it´s a shoot in the dark.

    /Dennis

  • Gary 40 posts 129 karma points
    Aug 02, 2013 @ 12:55
    Gary
    0

    Dennis, you are a star! Thank you so much this worked like a charm!!

    Much appreciated.

    Gary

Please Sign in or register to post replies

Write your reply to:

Draft