Copied to clipboard

Flag this post as spam?

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


  • Alexandru 112 posts 272 karma points
    Oct 21, 2013 @ 11:15
    Alexandru
    0

    Media Picker display

    Hi, I am trying to make a macro that will display some elements from a doctype. All is fine other than the mediapicker type. I can't see the image. Can anyone point out what could be wrong?

    This is how the macro looks:

    <xsl:variable name="author" select="$currentPage/ancestor-or-self::umbBlog//umbBlogPost"/>
    
    <div id="writersWrapper">
        <xsl:for-each select="$currentPage/ancestor-or-self::umbBlog//Profiles">
            <xsl:sort select="./name" order="ascending"/>
            <a href="{umbraco.library:NiceUrl(./@id)}">
                <div class="oneWriter">
                    <div class="writerInfo">
                        <xsl:value-of select="./name" disable-output-escaping="yes" /> <br/>
                        <xsl:value-of select="./jobPosition" disable-output-escaping="yes" /> <br/><br/><br/>
                    </div>
                    <div class="writerPic">
                        <xsl:value-of select="./profilePicture" disable-output-escaping="yes" />
                    </div>
                    <div class="writerContact">
                        <xsl:value-of select="./email" disable-output-escaping="yes" /> <br/>
                        <xsl:value-of select="./departmentPhone" disable-output-escaping="yes" /> 
                    </div>
                </div>
            </a>
        </xsl:for-each>
    </div>
    
  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Oct 21, 2013 @ 12:48
    Dennis Aaen
    100

    Hi Alexandru,

    Try this one instead

    <xsl:variable name="author" select="$currentPage/ancestor-or-self::umbBlog//umbBlogPost"/>

    <div id="writersWrapper">
       
    <xsl:for-each select="$currentPage/ancestor-or-self::umbBlog//Profiles">
           
    <xsl:sort select="./name"order="ascending"/>
           
    <a href="{umbraco.library:NiceUrl(./@id)}">
               
    <div class="oneWriter">
                   
    <div class="writerInfo">
                       
    <xsl:value-of select="./name" disable-output-escaping="yes"/><br/>
                       
    <xsl:value-of select="./jobPosition" disable-output-escaping="yes"/><br/><br/><br/>
                   
    </div>
                   
    <div class="writerPic">
                       
    <xsl:variable name="media" select="umbraco.library:GetMedia(./
    profilePicture,0)"/>
                         
    <xsl:if test="
    $media">
                         
    <xsl:variable name="
    url" select="$media/umbracoFile"/>
                         
    <xsl:variablename="
    alt" select="$media/@nodeName"/>
                         
    <xsl:variable name="
    width" select="$media/umbracoWidth"/>
                         
    <xsl:variable name="
    height" select="$media/umbracoHeight"/>
                             
    <img src="
    {$url}" alt="{$alt}" width="{$width}" height="{$height}"/>
                       
    </xsl:if>                
                   
    </div>
                   
    <div class="
    writerContact">
                       
    <xsl:value-of select="
    ./email" disable-output-escaping="yes"/><br/>
                       
    <xsl:value-of select="
    ./departmentPhone" disable-output-escaping="yes"/>
                   
    </div>
               
    </div>
           
    </a>
       
    </xsl:for-each>
    </div>
     
       

    The attributs width, height and alt tag, are optional.

    Hope this helps,

    /Dennis

  • Alexandru 112 posts 272 karma points
    Oct 21, 2013 @ 13:18
    Alexandru
    0

    Thank you so much for this. It was of great help! :)

Please Sign in or register to post replies

Write your reply to:

Draft