Copied to clipboard

Flag this post as spam?

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


  • Partha Ghosh 9 posts 64 karma points
    Oct 25, 2012 @ 17:26
    Partha Ghosh
    0

    Changing the style of a Header Menu Item

    Hello All,

    How can I change the size of a particular header navigation menu item? One of my left navigation menu text is longer and it wraps to a new line. I want to avoid this and display the menu text in smaller font.

    Best Regards,

    Partha

     

  • Jon Dunfee 199 posts 468 karma points
    Oct 30, 2012 @ 17:09
    Jon Dunfee
    0

    Partha, I've ran into the same situation and there are several solutions.  On every site I work on I create corresponding doc type fields for every label that would typically refer to the node name in the content tree.  

    Here's an example of utilizing an override field directly in your template:

    <umbraco:Item field="siteName" useIfEmpty="pageName" insertTextBefore="&lt;span&gt;" insertTextAfter="&lt;/span&gt;" recursive="true" runat="server" />

    Here's an example of how I use it in a macro XSLT:

        <span class="nav-text">
          <xsl:choose>
            <xsl:when test="$link/mainNavText != ''">
              <xsl:value-of select="$link/mainNavText" />
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="$link/@nodeName"/>
            </xsl:otherwise>
          </xsl:choose>
        </span>

    Now, if you can't change the text and you want it to fit then you may be dealing with some css trickery.  For that we all may need to see some example to provide some helpful solutions.

Please Sign in or register to post replies

Write your reply to:

Draft