Copied to clipboard

Flag this post as spam?

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


  • Brian A 13 posts 34 karma points
    Oct 08, 2010 @ 18:11
    Brian A
    0

    XSLT can't display property

    Hi,

    Just changed my Umbraco 4.0.3 to 4.5.2 and now one of my xslt scripts doesn't work.
    Basically I pick an image from the media library and via xslt I display that image.

    XSLT:

    <xsl:if test="string($currentPage/ancestor-or-self::node/data [@alias='homepageLogo']) != '' ">
    <xsl:element name="img">
    <xsl:attribute name="src">
    <xsl:value-of select="umbraco.library:GetMedia($currentPage/ancestor-or-self::node/data[@alias='homepageLogo'], 'false')/data [@alias = 'umbracoFile']"/>

    On the document type I create an property: homepageLogo, type: media picker and off course inserting the macro to the template - and that's it.

    But nothing comes out of the xslt - any thoughts?

    Rgds

    Brian

     

     

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Oct 08, 2010 @ 18:46
    Morten Bock
    0

    Try this:

    <xsl:if test="string($currentPage/ancestor-or-self::*/homepageLogo != '' ">
    <xsl:element name="img">
    <xsl:attribute name="src">
    <xsl:value-of select="umbraco.library:GetMedia($currentPage/ancestor-or-self::*/homepageLogo, 'false')/umbracoFile"/>
    
    Umbrac 4.5.2 has introduced a new XML schema. You can read more about it here:
  • Brian A 13 posts 34 karma points
    Oct 08, 2010 @ 19:37
    Brian A
    0

    Ahhh! Thanks a million!

  • Ernst Utvik 123 posts 235 karma points
    Oct 08, 2010 @ 19:43
    Ernst Utvik
    0

    There is an online translator from the old to the new schema:

    http://blackpoint.dk/umbraco-workbench/tools/convert-xml-schema-to-45-.aspx?p=2

    Some bugs exist but it should help you on your way.

Please Sign in or register to post replies

Write your reply to:

Draft