Copied to clipboard

Flag this post as spam?

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


  • Ashok Raja 12 posts 32 karma points
    Oct 12, 2010 @ 18:28
    Ashok Raja
    0

    Problem with umbraco.library:GetMedia() in 4.5.2

    Have changed the xslt schema from

    <xsl:attribute name="src">

    <xsl:value-of select="umbraco.library:GetMedia(data[@alias = 'navigationImage'], 'false')/data"/>

    </xsl:attribute>

     

    to

    <xsl:attribute name="src">

    <xsl:value-of select="umbraco.library:GetMedia(navigationImage, 'false')/data"/>

    </xsl:attribute>

    but the url data is fetched.

    Details from umbraco.config file

     

          <node id="5934" version="d455c71b-f274-4aee-beeb-a7f698be9593" parentID="5933" level="3" writerID="0" creatorID="12" nodeType="1872" template="0" sortOrder="1" createDate="2009-11-16T10:11:12" updateDate="2010-07-12T15:28:24" nodeName="netflights-logo" urlName="netflights-logo" writerName="Administrator" creatorName="Jonathan Percy" nodeTypeAlias="NavigationItem" path="-1,1873,5933,5934">

            <data alias="pageId">1261</data>

            <data alias="seoFooterHtml"><![CDATA[]]></data>

            <data alias="url">

            </data>

            <data alias="openInNewWindow">0</data>

            <data alias="ExcludeSitemap">0</data>

            <data alias="navigationImage">5932</data>

            <data alias="navigationImageAltText">Netflights</data>

          </node>

    Please advice.

     

  • Bart de Jonge 29 posts 51 karma points
    Oct 19, 2010 @ 17:14
    Bart de Jonge
    0

    Looks almost ok. I use <xsl:value-of select="umbraco.library:GetMedia(navigationImage, 'false')"/>

    If the image is on the currentpage you can use: <xsl:value-of select="umbraco.library:GetMedia($currentPage/navigationImage, 'false')"/>

  • Kim Andersen 1447 posts 2196 karma points MVP
    Oct 19, 2010 @ 19:23
    Kim Andersen
    0

    Hi Ashok

    The XML that you provided is the old one. Not the new schema used in v4.5.x.

    Could you try having a look in your umbracoSettings.config and see if the value in the <UseLegacyXmlSchema> is set to false?

    If that's the case please try to republish the whole website.

    When you are working with the new XML schema, you should be able to grab the source to an image like this:

    <xsl:value-of select="umbraco.library:GetMedia($currentPage/navigationImage, 0)/umbracoFile" />

    I hope the above makes sense :)

    /Kim A

Please Sign in or register to post replies

Write your reply to:

Draft