Copied to clipboard

Flag this post as spam?

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


  • eddy 43 posts 64 karma points
    Aug 25, 2010 @ 16:50
    eddy
    0

    Node Type Alias not showing

    Whilst reading the XSLT Basics Book, I tried to present on my homepage all the standard data available using the value-of command e.g. node ID, node name, level, writer etc.

    They all worked fine except for the Node Type Alias which rendered blank. Here is the simple code I used in the template:

    <p><xsl:value-of select="$currentPage/@nodeTypeAlias"/></p>

     

    I then tried to present some non-standard data as outlined in the documentation and that didn't work either:

    <p>Non-Standard Data :<xsl:value-of select="$currentPage/data [@alias='summary']"/></p>

     

    Is there something I have overlooked? Why can I not print the document's alias or the summary?

    Thanks, Eddy

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Aug 25, 2010 @ 16:51
    Ismail Mayat
    0

    What version of umbraco are you using the first bit should work regardless of version the second bit will only work pre 4.5 or 4.5 with legacy schema turned on.

    Regards

    Ismail

  • eddy 43 posts 64 karma points
    Aug 25, 2010 @ 16:57
    eddy
    0

    Hi Ismail,

    That was quick! I'm using v 4.5.1.

    Eddy

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Aug 25, 2010 @ 17:02
    Ismail Mayat
    1

    Eddy,

    I am assuming your are on latest schema so instead use this wiki entry

    http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/xslt-examples-updated-to-new-schema

    regards

    Isamil

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Aug 25, 2010 @ 17:03
    Morten Bock
    0

    Hi Eddy

    The xml schema has changed from 4.0.x to 4.5.1, so there are a few things that need to be done differently than in the book you mention.

    You can read a bit about the differences in the schema here:

    http://our.umbraco.org/wiki/reference/xslt/45-xml-schema

    The new equivalent of the samples you mention would be:

    nodeTypeAlias: <xsl:value-of select="local-name($currentPage)" />
    This is no longer an attribute, but the actual name of the element.

    Non-Standard Data :<xsl:value-of select="$currentPage/summary"/>
    Data fields are now saved in named elements instad of having aliases.

     

  • eddy 43 posts 64 karma points
    Aug 25, 2010 @ 17:25
    eddy
    0

    Hi Ismail, Hi Morten,

    The new samples work just fine now and I'll add those links you have provided to my reading list. 

    Thanks, Eddy

     

Please Sign in or register to post replies

Write your reply to:

Draft