'mediaCurrent' is just like a Media Picker on a document type. I mention this so you can search for forum for more info on the GetMedia() function if you're interested. That will explain the other information that is appended to the end.
But without forcing you to read more if you're not overly interested in 'why'... the solution is the following:
I know it is for swfobject 1.5. That is because of the different way the two are implemented. In 2.2 the code is all in the head, while in 1.5 it's all in the body - i think, for this particular thing, where the end-user have to insert in the richtext editor - that the 1.5 is the easiest one as i can insert all at once. Maybe i'm wrong, but I know this one works when hardcoded.
It's almost identical to Doug's suggestion, except for the '//' selector instead of '/'. It's shorthand for find a data node regardless of its level for which alias attribute has a value equal to 'umbracoFile'
Output the path chosen in macro
Hi,
I have a macro which can be used in the richtext editor. It is for inserting flash.
When the end-user inserts the macro, the user must set the path (via mediaCurrent) and the width and height (as numbers)
The width and height works fine, and the path almost works!
my xlst for the path looks like this:
Where "videopath" is the alias of the parameter set in the macro.
this xslt gives me this in the html: /media/25565/flvplayer_progressive.swfswf9038 - i want to get rid of the bold part (swf9038)
but how to?
i have with different versions of alias = 'umbracoFile' but it gives errors - probably because the syntax is not correct.
Best regards
Brian
This isnt how i remember it, but the code below seems to work for me in another site
<xsl:variable name="videoName" select="umbraco.library:GetMedia(/macro/videopath, 'false')/data [@alias = 'umbracoFile']" />
If this doesnt work, use
and see what come out, then adjust the xpath to suit
'mediaCurrent' is just like a Media Picker on a document type. I mention this so you can search for forum for more info on the GetMedia() function if you're interested. That will explain the other information that is appended to the end.
But without forcing you to read more if you're not overly interested in 'why'... the solution is the following:
cheers,
doug.
You are outputting all cpntent of the videopath node - thats why you get too much text.
Instead you need to select the specific field of interest.
E.g. like this:
>Tommy
Hi all!
Thank for your suggestions - none of them are however working though (or i'm not inserting them right!)
Douglas: You code-snippet i have tried, and i have iterated through the forum without finding anything i could use.
My xlst looks like this, if this is of any help:
i have written "MISSING CODE HERE" where i need to insert the parameter.
Hope that someone would like to help out a xslt-newbie :)
best regards,
Brian
This may or may not be related to your problem - but the embed code there is for swfobject 1.5, so if you're using swfobject 2.2 it won't work.
Other than that, do
And post what comes out. I'm almost certain that the solution is in at least one of the above posts!
Hi Dan
I know it is for swfobject 1.5. That is because of the different way the two are implemented. In 2.2 the code is all in the head, while in 1.5 it's all in the body - i think, for this particular thing, where the end-user have to insert in the richtext editor - that the 1.5 is the easiest one as i can insert all at once. Maybe i'm wrong, but I know this one works when hardcoded.
The code outputs the following in the html:
<videopath>
<node id="1817" version="11d0e8e6-989a-4b06-8fbd-eb3eaf79b9d5" parentID="1814" level="2" writerID="2" nodeType="1033" template="0" sortOrder="1" createDate="2009-09-04T12:43:31" updateDate="2009-09-04T12:43:31" nodeName="FLVPlayer" urlName="flvplayer" writerName="Dorthe" nodeTypeAlias="File" path="-1,1814,1817">
<data alias="umbracoFile">/media/25565/flvplayer_progressive.swf</data>
<data alias="umbracoExtension">swf</data>
<data alias="umbracoBytes">9038</data>
</node>
</videopath>
So, I know it is the bold part i need to get my hands on. But just can't seem to get it to work.
Any ideas
Hi Brian,
Me thinks you need this:
It's almost identical to Doug's suggestion, except for the '//' selector instead of '/'. It's shorthand for find a data node regardless of its level for which alias attribute has a value equal to 'umbracoFile'
Cheers,
/Dirk
Hi Dirk!
Me think you are right - that is so great! You just saved my until now very bad Umbraco day :)
Thanks to all for your help!
best regards,
Brian
is working on a reply...