Copied to clipboard

Flag this post as spam?

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


  • hetaurhet 245 posts 267 karma points
    Jul 29, 2011 @ 08:09
    hetaurhet
    0

    inline xslt problem in template

    hello

    I am using umbraco 4.7. and writing following line in my template. but it is not showing image.

    Image field is of the type media picker.

    <umbraco:Item field="NewsImage" insertTextBefore="&lt;img src=&quot;" xslt="concat('&lt;img src=&quot;',umbraco.library:GetMedia({0}, false())/umbracoFile, '&quot; /&gt;')" xsltDisableEscaping="true" runat="server"></umbraco:Item>


  • Dennis Aaen 4457 posts 17970 karma points admin hq c-trib
    Jul 29, 2011 @ 08:28
    Dennis Aaen
    0

    Hi Hetaurhet,

    Maybe you could try it here instead.

    <umbraco:Item runat="server" field="NewsImage" xslt="concat('&lt;img src=&quot;',umbraco.library:GetMedia({0}, true())/umbracoFile, '&quot; /&gt;')" xsltDisableEscaping="true"/>

    I found the example on the Umbraco Wiki.
    http://our.umbraco.org/wiki/reference/templates/umbracoitem-element/inline-xslt

    Hope it helps you.

    /Dennis

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Jul 29, 2011 @ 08:29
    Dirk De Grave
    0

    hetaurhet,

    From looking at your code, your output would be

    <img src="<img src="path.to.img" />"

    So, either remove the insertTextBefore or change the xslt attribute to only use umbraco.library:GetMedia({0},false())/umbracoFile. 

     

    Hope this helps.

    Regards,

    /Dirk

  • hetaurhet 245 posts 267 karma points
    Jul 29, 2011 @ 10:16
    hetaurhet
    0

    thanks ....

    <umbraco:Itemrunat="server"field="mediaItem"xslt="concat('&lt;img src=&quot;',umbraco.library:GetMedia({0}, true())/umbracoFile, '&quot; /&gt;')"xsltDisableEscaping="true"/>

    this worked out for me.....

  • Dennis Aaen 4457 posts 17970 karma points admin hq c-trib
    Jul 29, 2011 @ 10:40
    Dennis Aaen
    0

    Hi Hetaurhet,

    I'm glad to hear that you got it working :-), and I'm glad I could help you.

    /Dennis

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies