Copied to clipboard

Flag this post as spam?

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


  • Jan 54 posts 74 karma points
    Jul 02, 2010 @ 10:01
    Jan
    0

    Need to place media path in a span tag

    hey - i have a javascript that uses a path that has been place inside a span

    <span class="javacriptclass">Path placed here will be used in javascript</span>

    i am trying to find out how to place a media picker there but its outside of the tag.
    i know this should be obvious but i just cant see it ?

    this is the code i got so far.

    <xsl:for-each select="umbraco.library:GetXmlNodeById(1373)/node [string(data [@alias='umbracoNaviHide']) != '1']">
    <!-- <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']"> -->

        <xsl:if test="data[@alias='femiletpicture'] != ''">
        
        <!-- get the media XML and assign it to a variable -->
        <xsl:variable name="media" select="umbraco.library:GetMedia(number(data[@alias='femiletpicture']), 0)" />
                                    
        <!-- check if the media XML contains an image path 'umbracoFile' -->
            <xsl:if test="count($media/data[@alias='umbracoFile']) &gt; 0">

                   <div class="simpleCart_shelfItem">

                        <h2 class="item_name"><xsl:value-of select="data [@alias = 'femiletname']"/></h2>

                             <img src="{$media/data[@alias='umbracoFile']}" alt="" title="" class="item_image" />
                   
                        <span class="item_price"><xsl:value-of select="data [@alias = 'femiletprice']"/>&nbsp;KR,-</span>

                        <a href="javascript:;" class="item_add">Tilføj til kurv</a>

                        <span class="item_thumb">

                        <!--- HERE IS WHERE i NEED THE PATH TO THE PICTURE PLACED -->

                        </span>


                   </div>

            </xsl:if>
        </xsl:if>

    </xsl:for-each>

    im not sure what im doing wrong as i tried to place the {$media/data[@alias='umbracoFile']}
    but it just posts as {$media/data[@alias='umbracoFile']} - im unsure how to place this properly?.


    it needs to return the path like this on the page so the javascript can use it.

    /media/3045/somepicture.jpg
  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Jul 02, 2010 @ 10:04
    Dirk De Grave
    0

    you can just use

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

    in the span tag

     

    Hope this helps.

    Regards,

    /Dirk

  • Jan 54 posts 74 karma points
    Jul 02, 2010 @ 10:24
    Jan
    0

    Ok thank you - weird i tried that earlier O.o - must have forgotten to reload the page properly or something.  Thanx dirk

  • 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