Copied to clipboard

Flag this post as spam?

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


  • Vincent DeCapite 64 posts 83 karma points
    Oct 14, 2010 @ 19:24
    Vincent DeCapite
    0

    Problem opening up SWF from link

    From the template I have an option for the user to pick a media file to attach to the link as shown here in the productAnimation1 Section:

    In my template I have a piece of XSLT code that state:

    <xsl:if test="$product/data [@alias = 'productAnimation1'] != ''">

    <li><a href="{$product/data [@alias = 'productAnimation1']}" target="_blank">DeCapiteTEst</a></li>

    </xsl:if>

    When the page load though, it its getting the folder ID, but it is not getting the File Name so the actual file will open. I am getting this as the URL:

    http://10.1.20.195/product/productcat/productsubcat/3265 (no file name of this at the end)

    .. I am new to XSLT and passing variables like this so any help would be greatly appreciated.. Thanks

     

  • Rich Green 2246 posts 4006 karma points
    Oct 14, 2010 @ 20:10
    Rich Green
    0

    Hi Vincent,

    The problem you are having is that the ProductAnimation1 property holds the Node Id of the media item selected, so in your example your Snare_Release04.swf file will have a node id of 3265.

    To understand how to get the values from node Lee has a great post here http://blog.leekelleher.com/2009/11/30/how-to-use-umbraco-library-getmedia-in-xslt/

    You need to change your code to something like this:

     <xsl:variable name="mediaId" select="number($product/data[@alias='productAnimation1'])" />
    
        <xsl:if test="$mediaId &gt; 0">
    
            <xsl:variable name="mediaNode" select="umbraco.library:GetMedia($mediaId, 0)" />
    
            <xsl:if test="count($mediaNode/data) &gt; 0 and string($mediaNode/data[@alias='umbracoFile']) != ''">
    
                <a href="{$mediaNode/data[@alias='umbracoFile']}"><xsl:value-of select="$mediaNode/@nodeName"/><a/>
    
            </xsl:if>
    
        </xsl:if>
    
     Hope this helps

    Rich
  • Vincent DeCapite 64 posts 83 karma points
    Oct 14, 2010 @ 20:19
    Vincent DeCapite
    0

    Awesome That Worked... Thanks!

  • 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