Copied to clipboard

Flag this post as spam?

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


  • Donald Swofford 13 posts 107 karma points
    Aug 11, 2014 @ 15:57
    Donald Swofford
    0

    How to insert an image next to each node in a list.

    I am using the code below to show a list of nodes.  To the document type of these nodes I have added a Unamed Checkbox Group.  I would like to display an icon for each box that is checked next to the node.   For example if someone checked blue it might show an image to the right of the item in the list.

    <xsl:variable name="startNode" select="$currentPage/ancestor-or-self::*[@level = $level]" />
    <xsl:variable name="nodesToShow" select="$startNode/*[@isDoc][not(umbracoNaviHide = 1)]" />

    <xsl:if test="$nodesToShow">
       
    <img src="http://myheaderimage.png" />

       
    <ul>
           
    <xsl:for-each select="$nodesToShow">
               
    <li>
                   
    <a href="{umbraco.library:NiceUrl(@id)}">
                       
    <xsl:value-of select="@nodeName" />
                   
    </a>
               
    </li>
           
    </xsl:for-each>
       
    </ul>
    </xsl:if>
  • Donald Swofford 13 posts 107 karma points
    Aug 11, 2014 @ 20:55
    Donald Swofford
    0

    I have changed the code a bit which now shows the label of the checkbox. Anyone have any ideas on how to turn these words into an image?  For example if the item had the video option checked in the checkbox group it now shows

    Node Name video

     

    <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">

    <li>

    <a href="{umbraco.library:NiceUrl(@id)}">

    <xsl:value-of select="@nodeName"/>

    </a>

    <span class="extras">&nbsp;<xsl:value-of select="activityextras"/></span>

    </li>

    </xsl:for-each>

Please Sign in or register to post replies

Write your reply to:

Draft