Can someone give me a working example of "GetMedia" using the mediapicker in a macro?
I must have tried 5 different xslt examples of inserting a image onto a page but nothing works for me.
can someone give me an "idiots guide"
I have come from CMSMS but wanted to give this umbraco a try
[code]
Error occured
System.Xml.Xsl.XsltException: The variable or parameter 'image' is either not defined or it is out of scope.
[/code]
And if I take out the "if" statements and save with "Skip testing (ignore errors)" checked
and try place the macro on a page I get:
"Error parsing XSLT file: \xslt\testing.xslt"
This is the kind of frustrations I have been up against all week trying to do this.
does someone have a complete idiots guide to this?
is there any documentation about how to use mediapicker and place the variables in a macro and how the macro is supposed to look?
dropping the macro on a page does not render anything.
macro properties are set to:
"Use in editor" checked=yes
"Render content in editor" checked=yes
after picking an image nothing shows up...just blank
Is this the correct way to use it in a macro in a template?
[code]
[/code]
what I want to do is setup a different header image for different parts of the site and be able to use mediapicker to choose the different headers.
but so far cannot get the mediapicker to work.
I cannot get mediapicker to work
Can someone give me a working example of "GetMedia" using the mediapicker in a macro?
I must have tried 5 different xslt examples of inserting a image onto a page but nothing works for me.
can someone give me an "idiots guide"
I have come from CMSMS but wanted to give this umbraco a try
I think this is what you're looking for.
[code]
[/code]
[quote=Duke Maximus]I think this is what you're looking for.
[code]
[/code][/quote]
And to avoid an error when saving the XSLT, put an if:test around the GetMedia function call:
when I place that snippet into a xslt like so:
[code]
]>
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">
[/code]
I get this error:
[code]
Error occured
System.Xml.Xsl.XsltException: The variable or parameter 'image' is either not defined or it is out of scope.
[/code]
And if I take out the "if" statements and save with "Skip testing (ignore errors)" checked
and try place the macro on a page I get:
"Error parsing XSLT file: \xslt\testing.xslt"
This is the kind of frustrations I have been up against all week trying to do this.
does someone have a complete idiots guide to this?
is there any documentation about how to use mediapicker and place the variables in a macro and how the macro is supposed to look?
Hi,
What if you'd write this:
[code]
[/code]
(adding the img tag inside the if statement, to make sure the variable is still in scope at that point)
Hope this helps.
Regards,
/Dirk
@Dirk, thanks for that.
so now the xslt will save without complaining, this is what the whole xslt looks like now:
[code]
]>
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">
[/code]
dropping the macro on a page does not render anything.
macro properties are set to:
"Use in editor" checked=yes
"Render content in editor" checked=yes
after picking an image nothing shows up...just blank
Is this the correct way to use it in a macro in a template?
[code]
[/code]
what I want to do is setup a different header image for different parts of the site and be able to use mediapicker to choose the different headers.
but so far cannot get the mediapicker to work.
I am now able to insert an image using the mediapicker with this xslt:
[code]
]>
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">
[/code]
when I drop the macro on a page I see the image in the editor but it does not show up on the web page?
What are you passing in
[code][/code]
What parameter type are you using by the way?
is working on a reply...