Copied to clipboard

Flag this post as spam?

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


  • Asad Kizzie 24 posts 154 karma points
    Dec 18, 2023 @ 14:57
    Asad Kizzie
    0

    XSLT Pull Image from Page Template

    I am creating a macro that will list all the subpages under a parent. For each subpage, I want to also pull the image that is in the template.

    Using the code below displays the URL to the image:

    <xsl:value-of select="data [@alias = 'myImage']"/>
    

    Using this code below produces an error:

    <img src={umbraco.library:GetMedia($currentPage/myImage,'false')/umbracoFile}" />
    

    What is the correct syntax to use?

  • Asad Kizzie 24 posts 154 karma points
    Dec 18, 2023 @ 17:41
    Asad Kizzie
    100

    Figured it out! This is the solution that works:

    <img>
        <xsl:attribute name="src">
            <xsl:value-of select="data [@alias = 'myImage']" />
        </xsl:attribute>
    </img>
    
Please Sign in or register to post replies

Write your reply to:

Draft