Copied to clipboard

Flag this post as spam?

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


  • Markus Bindhammer 3 posts 1 karma points
    Jul 09, 2009 @ 15:13
    Markus Bindhammer
    0

    Alias names from Doctype properties to macro

    I have a little tricky idea for Multilanguage Text Propertys. I have no idea if this is possible or not.

    Finally i get the Multilanguage Thing working on a new Projekt.

    I used the Tut for Multilanguages Sites with makros (<xsl:include href="../xslt/lang_lib.xslt" />)

    But i want it a little bit different at all.

    What i need is an possibillity to gave the Alias names from Doctype properties to my macro.

    There i change the Alias name by Language.

    For example i got an RTE Field "startseite_text" and one "startseite_text_en" for two languages.

    i want the Alias "startseite_text" in my Makro, change it if neccassary to "startseite_text_en" and then giv out the Text inside.

    This is really hard, is it possible???

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 09, 2009 @ 15:51
    Jan Skovgaard
    0

    I guess it would be possible to do by making a querystring where you can check the value of it. For instance you could have http://yoursite.de/default.aspx?language=de to show the german text and to get the english text you would need to change the value of the querystring to "en".

    Does the above make any sense?

    It will require you to make a check for the querystring in all those XSLT macros where you are fetching text content in different languages. The check could look something like this

    <xsl:variable name="Language">
    <xsl:choose>
    <xsl:when test="umbraco.library:RequestQueryString('lang') = 'en'">en</xsl:when>
    <xsl:otherwise>en</xsl:otherwise>
    </xsl:choose>
    </xsl:variable>

    When you need to decide if you are in need of the english content you could have a test-scenario like this

    <xsl:if test="$Language = 'de'">
    <xsl:value-of select="$currentPage/data [@alias = 'startseite_text']"/>
    </xsl:if>
    <xsl:if test="$Language = 'en'">
    <xsl:value-of select="$currentPage/data [@alias = 'startseite_text_en']"/>
    </xsl:if>

    I hope this is what you are looking for.

    /Jan

  • Markus Bindhammer 3 posts 1 karma points
    Jul 10, 2009 @ 09:23
    Markus Bindhammer
    0

    No, the Language selection works. That is not what i needed.

    I know its hard to understand. :-)

    1. i have an Documenttype with an Text Field 'startseite_text'

    2. i have an Template where i called my Makro for Language Swichting.

    With the call of the Makro i give the xslt the Content of 'startseite_text'.

    This works fine.

     

    But i need the Text Field Alias itself in the xslt to change the Name of the Variable. (Language Selection)

    I want to change the Variable from 'startseite_text' to "startseite_text_en".

    Right now i donĀ“t get the Alias name of the Text Field. Is this possible? How cann i solve this?

Please Sign in or register to post replies

Write your reply to:

Draft