Yes and no - parameters are the only kind you can set from the outside (whether that's from outside of a template with the <xsl:with-param> instruction, or the way $currentPage gets set from the XSLT processor).
Are you getting no output at all, or is it just the src attributes that are empty? Seems weird that you're getting no output at this point... which version of Umbraco are you using?
Tried dumping the raw XML (macro & mediaNodes)? e.g.:
I now have some more information: The macro parameter type "mediaCurrent" stores more than just the ID for a media node. It stores every thing from the selected media.
So does anyone have an idea to avoid that? An idea that goes further that manually type the ID for the media node...
Please forgive us - the entire community - for this :-)
D'oh! - of course - I just couldn't make sense of it - until now, of course...
Well, you just need to pick the parts you need - no need to call GetMedia(), since you've already got the mediaNode data - just make your way to the umbracoFile property of each:
Note, I'm using curly braces (called an "Attribute Value Template") instead of the verbose <xsl:attribute> element (much better when you can just pick the data needed).
I have already tried what you suggest, but for some reason that dosen't work for me (or Umbraco). I know that it is the typical way to do it with normal GetMedia calls, but this is strange!
When I do it like you (Chriztian) posted, I get an empty link with an empty image. The alt attribute is correct.
Note I have created a new media type now that contains both the videofile and the image. But I have tried the same solution earlier with almost same result.
Macro doesn't pass values?
Why won't my macro "Videoplayer" pass the values video, picture and title to the xslt?
My code is:
Your help is highly appreciated!
try this:
Also check the aliases of the parameters you're passing, these are case sensitive.
Cheers,
/Dirk
Hi Webspas,
You've misspelled "macro" as "marco" in the very first line (D'oh! :-)
Since the rest of the code relies on this first $v parameter, nothing is output...
/Chriztian
Hehe, forgot to change that, I was aware of that misspelling, just forgot to change it in my code snippet, thanks for rectifying it Chriztian!
@Chriztian, does that mean you're also allowed to use <xsl:param> instead of <xsl:variable>?
Cheers,
/Dirk
Yes and no - parameters are the only kind you can set from the outside (whether that's from outside of a template with the <xsl:with-param> instruction, or the way $currentPage gets set from the XSLT processor).
/Chriztian
A great thanks for your replies!
But I still don't get any output at all...?!
The code now looks like this:
I use a variable like this on my xslt's
<xsl:variable name="OutputLimit" select="/macro/outLimit"/>
Did you add the parameter? Fint the macro for the xslt under the "macros" section and add your parameters under the parameters tab.
Yes I did add the parameters (see the screenshot below)
And in the ritch text editor the macro looks like this:
try writing some lorem ipsum before the if statement. Do you get anything out at all?
If not, did you remember to put your field on your template?
<umbraco:Item field="yourmacroname" runat="server">umbraco:Item>
Yes, I do get output if I type something befor and/or after the if statement.
Could it be something with the parameter names or alias? Or types?
Hi Webspas,
Are you getting no output at all, or is it just the src attributes that are empty? Seems weird that you're getting no output at this point... which version of Umbraco are you using?
Tried dumping the raw XML (macro & mediaNodes)? e.g.:
/Chriztian
Okay now we are getting somewhere.
Now I get this output:
From this XSLT-code:
But I'm not sure how to get onlt the path for the videofile and the videoimage...
I now have some more information: The macro parameter type "mediaCurrent" stores more than just the ID for a media node. It stores every thing from the selected media.
So does anyone have an idea to avoid that? An idea that goes further that manually type the ID for the media node...
Hi Webspas,
Please forgive us - the entire community - for this :-)
D'oh! - of course - I just couldn't make sense of it - until now, of course...
Well, you just need to pick the parts you need - no need to call GetMedia(), since you've already got the mediaNode data - just make your way to the umbracoFile property of each:
Now I'm going to show you some funny stuff...
I have already tried what you suggest, but for some reason that dosen't work for me (or Umbraco). I know that it is the typical way to do it with normal GetMedia calls, but this is strange!
When I do it like you (Chriztian) posted, I get an empty link with an empty image. The alt attribute is correct.
When I remove the "umbracoFile" I get this:
Note I have created a new media type now that contains both the videofile and the image. But I have tried the same solution earlier with almost same result.
Oh darn it - there's a bug from 4.5.1 I think that wasn't fixed for mediaCurrent items... do this (now based on your new type):
Note the double slashes (//) to get to the properties...
(Don't know if you're still using title in that way - but you know what to do with it...)
/Chriztian
Yeay! That was it!
Thank you very much. And I'm sorry that I have forgot to repport what version I am using - it is 4.5.2 be the way.
is working on a reply...