Copied to clipboard

Flag this post as spam?

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


  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 29, 2011 @ 14:54
    Jeroen Breuer
    0

    Chinese menu not displayed

    Hello,

    I've created a menu that works in the english version of the website, but there is also a chinese version which is not displayed. The only difference is that there are chinese characters in the menu. The menu is renderd and I can click the links, but no text is displayed. Any idea what this could be?

    Jeroen

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Mar 29, 2011 @ 15:50
    Douglas Robar
    0

    Going to need a bit more info on this one. I've done all kinds of foreign characters and had no problems. I suppose it could be an encoding problem (are you using unicode and set your html page to render as unicode?)

    Can you give us an example of your xslt and some content nodes? 

    Also, what version of Umbraco?

    cheers,
    doug.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 29, 2011 @ 16:02
    Jeroen Breuer
    0

    Here is the XSLT I use to create the menu. I'm using Umbraco 4.6.1

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
      <!ENTITY nbsp "&#x00A0;">
      <!ENTITY raquo "&#187;">
    ]>
    <xsl:stylesheet 
        version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:ucomponents.cms="urn:ucomponents.cms" xmlns:ucomponents.dates="urn:ucomponents.dates" xmlns:ucomponents.io="urn:ucomponents.io" xmlns:ucomponents.media="urn:ucomponents.media" xmlns:ucomponents.members="urn:ucomponents.members" xmlns:ucomponents.nodes="urn:ucomponents.nodes" xmlns:ucomponents.strings="urn:ucomponents.strings" xmlns:ucomponents.urls="urn:ucomponents.urls" xmlns:ucomponents.xml="urn:ucomponents.xml" 
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ucomponents.cms ucomponents.dates ucomponents.io ucomponents.media ucomponents.members ucomponents.nodes ucomponents.strings ucomponents.urls ucomponents.xml ">
    
    
      <xsl:output method="html" omit-xml-declaration="yes" indent="yes"/>
    
      <xsl:param name="currentPage"/>
    
      <!-- Get the home node. -->
      <xsl:variable name="home" select="$currentPage/ancestor-or-self::Home[@isDoc]" />
    
      <!-- The nodes which will be displayed. Sorted in the correct order. -->
      <xsl:variable name="temp_nodes">
        <xsl:for-each select="$home/*[@isDoc and hideInMenu=0]">
          <xsl:sort order="ascending" select="@sortOrder" data-type="number"/>
          <xsl:copy-of select="." />
        </xsl:for-each>
      </xsl:variable>
    
      <!-- Convert the nodes to a value which is easier to work with. -->
      <xsl:variable name="nodes" select="msxml:node-set($temp_nodes)/*[@isDoc]" />
    
      <!-- The total amount of items. -->
      <xsl:variable name="totalItems" select="count($nodes)" />
    
      <xsl:template match="/">
    
        <!--Display the home node.-->
        <li>
          <a href="{umbraco.library:NiceUrl($home/@id)}">
            <xsl:value-of select="$home/pagetitle"/>
          </a>
        </li>
    
        <xsl:if test="$totalItems &gt; 0">
    
          <!-- Loop through nodes. -->
          <xsl:for-each select="$nodes">
    
            <!--Display the other menu items.-->
            <li>
              <a href="{umbraco.library:NiceUrl(@id)}">
                <xsl:value-of select="pagetitle"/>
              </a>
            </li>
          </xsl:for-each>
    
        </xsl:if>
    
      </xsl:template>
    
    </xsl:stylesheet>

    Jeroen

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Mar 29, 2011 @ 16:20
    Douglas Robar
    0

    Thanks.

    A couple questions for you...

    1. what happens if you change the output method to "xml" rather than "html"?

    2. when you view the source of the page with the chinese menu on it, do you get the right number of <li> and <a> items?

    3. if 'yes' to #2, what appears for the href and the <xsl:value-of select="pagetitle" /> for them? 

    cheers,
    doug.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Apr 05, 2011 @ 10:37
    Jeroen Breuer
    0

    I fixed it :). The problem wasn't xslt related. We used Cufon to replace some text and Cufon didn't support the chinese characters. So for the chinese version of the website we simply disabled Cufon :).

    Jeroen

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 05, 2011 @ 10:41
    Douglas Robar
    0

    Thanks for reporting back on the issue. I had similar problems with sifr once. You have to be sure the font supports the characters you need. In fact, you could use ImageGen to produce the text but again, you'd need a font that supported the characters you need. Couldn't you use a class attribute and change the base font for cufon or ImageGen for various languages? 

    Anyway, glad you got it sorted out.

    cheers,
    doug.

Please Sign in or register to post replies

Write your reply to:

Draft