Hi all i'm quite new to Umbraco so please bare with me. I've taken and re-used some code (found on this forum, many thanks) to insert a flash file into a template. However what i would like to do is be able for the end users to be able to select the flash file they want using the nice user friendly front end. My macro takes in the following parameters:
What i want to be able to do is to pass in instead of the video path of "1253" the path of the file that was selected using the media picker. I hope this is clear and hopefully someone could give me some direction!
Not possible OOB, as the mediaCurrent returns the id of the media item. But, as umbraco is quite flexible, it's possible to write your own macro rendering class that implements a specific interface IMacroGuiRendering that returns the media path instead of id. On the other hand, why do you need another gui for selecting a flash file from the media section?
Maco is an XSLT file. Basically i want the ability to be able to select the flash file through the nice user friendly section of the content section of umbraco. At the moment i can select the flash file but when inserting directly into a template. Below is my flash select macro:
Passing datasource id into macro id
Hi all i'm quite new to Umbraco so please bare with me. I've taken and re-used some code (found on this forum, many thanks) to insert a flash file into a template. However what i would like to do is be able for the end users to be able to select the flash file they want using the nice user friendly front end. My macro takes in the following parameters:
What i want to be able to do is to pass in instead of the video path of "1253" the path of the file that was selected using the media picker. I hope this is clear and hopefully someone could give me some direction!
Many Thanks
Vince
When you get the ID from the media picker you should be able to get the file from that ID reference.
Are you making the macro with a user control or an XSLT file?
Hi vince,
Not possible OOB, as the mediaCurrent returns the id of the media item. But, as umbraco is quite flexible, it's possible to write your own macro rendering class that implements a specific interface IMacroGuiRendering that returns the media path instead of id. On the other hand, why do you need another gui for selecting a flash file from the media section?
Cheers,
Maco is an XSLT file. Basically i want the ability to be able to select the flash file through the nice user friendly section of the content section of umbraco. At the moment i can select the flash file but when inserting directly into a template. Below is my flash select macro:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:variable name="videonode" select="/macro/Video"/>
<xsl:variable name="videopath" select="$videonode/node/data[@alias='umbracoFile']"/>
<xsl:variable name="videoheight" select="/macro/VideoHeight"/>
<xsl:variable name="videowidth" select="/macro/VideoWidth"/>
<!-- ============================================================= -->
<xsl:template match="/">
<xsl:copy-of select="$currentPage"/>
<div id="container"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript" src="/scripts/swfobject.js"></script>
<script type="text/javascript">
<![CDATA[
// Previous JavaScript code
var path = "]]><xsl:value-of select="$videopath" /><![CDATA[";
var videowidth = "]]><xsl:value-of select="$videowidth" /><![CDATA[";
var videoheight = "]]><xsl:value-of select="$videoheight" /><![CDATA[";
// Rest of JavaScript code
var s1 = new SWFObject(path,"SWF File",videowidth,videoheight,"9","#FFFFFF");
s1.addParam("allowfullscreen","true");
s1.addParam("allowscriptaccess","always");
s1.addParam("wmode","transparent");
s1.write("homeFlash");
]]>
</script>
</xsl:template>
<!-- ============================================================= -->
</xsl:stylesheet></span></span>
is working on a reply...