Copied to clipboard

Flag this post as spam?

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


  • Amir Khan 1287 posts 2744 karma points
    Apr 20, 2010 @ 21:55
    Amir Khan
    0

    Adding specific info to an item based on nodename

    Any ideas on how to add something to a navigation item based on nodename? I would like to add some code for a tooltip...

  • Ove Andersen 435 posts 1541 karma points c-trib
    Apr 21, 2010 @ 09:47
    Ove Andersen
    0

    Try to use one of these jQuery Tooltip plugins:

    And add the information you would like to pop up in your xslt:

    <xsl:attribute name="class">
        <xsl:value-of select="@nodeTypeAlias"/><xsl:text> hoverclass</xsl:text>
    </xsl:attribute>   
    <xsl:attribute name="title">   
        <xsl:value-of select="@nodeName"/>|<xsl:value-of select="./data [@alias = 'bodyText']" disable-output-escaping="yes"/>
    </xsl:attribute>

    The text you add to the attribute title will pop up in the tooltip. This happens even if you don't use a plugin. The plugin is only used to make it look nicer.

    You can take a look at my website where i use clueTip and the above code to render a nice preview of the article in the tooltip.

  • Amir Khan 1287 posts 2744 karma points
    Apr 21, 2010 @ 22:05
    Amir Khan
    0

    Perfect! Thank you.

  • Amir Khan 1287 posts 2744 karma points
    Apr 21, 2010 @ 22:38
    Amir Khan
    0

    Incase anyone else is looking to do this, this is what i used in my navigation logic to add the tooltip to a specific document type "Future Links"

     

     <xsl:if test="@nodeTypeAlias='Future Products'">
    <xsl:attribute name="class">
    <xsl:value-of select="@nodeTypeAlias"/><xsl:text> hoverclass</xsl:text>
    </xsl:attribute>
    <xsl:attribute name="title">
    <xsl:value-of select="./data [@alias = 'title']" disable-output-escaping="yes"/>
    </xsl:attribute>
    </xsl:if>
Please Sign in or register to post replies

Write your reply to:

Draft