Hi I'm brand new to Umbraco and hope someone can help me out.
Here's what I'm trying to do.....
I've setup a document type called 'DefaultHome'. I've added a number of properties one of which is a Media Picker named home_imgLeft. My intent is that an editor can use the media picker property to select an image from the media library.
I've setup a template that has an image tag. The document type above uses this this template. I'm having problems getting the value of the home_imgLeft to translate into a URL. Currently nothing comes back using the macro. If I just insert the umbraco field into the template I get back '1066'.
I've looked around on the forum and found some XSLT examples but am still having problems, hope someone can tell me what I'm doing wrong.
Ahh didn't see your second reply before I posted my answer (I had opened this post as well as others in several tabs, and took some time before I got to this one :) ).
But did it work for you, or do you stille have the problem?
XSLT for placing an image on a page
Hi I'm brand new to Umbraco and hope someone can help me out.
Here's what I'm trying to do.....
I've setup a document type called 'DefaultHome'. I've added a number of properties one of which is a Media Picker named home_imgLeft. My intent is that an editor can use the media picker property to select an image from the media library.
I've setup a template that has an image tag. The document type above uses this this template. I'm having problems getting the value of the home_imgLeft to translate into a URL. Currently nothing comes back using the macro. If I just insert the umbraco field into the template I get back '1066'.
I've looked around on the forum and found some XSLT examples but am still having problems, hope someone can tell me what I'm doing wrong.
Template code ......
XSLT code ......
Hi Bob
First of all you gotta use this package, XMLDump, since it'll save you a lot of time.
When using XMLDump you can get a preview of the XML like this.
http://dammark.dk.nt12.unoeuro.com/xmldump.aspx?media=1106
This is a website I'm building for my self.
Now you can try to show us the XML output of 'umbraco.library:GetMedia($currentPage/data[@alias='home_imgLeft'], 'false')' ...
Ok I think I'm XMLDump correctly in this case. Here's what I get back when I put in my URL .....
http://192.168.200.201/xmldump.aspx?media=1066
Bob, which version of Umbraco are you using? Just need to know if you are using the new or the old XML schema.
If you are using the "new" XML schema (default since v4.5.1 (in v4.5 there was a small bug)) this code should be working for you:
But yeah, like Sebastian says, it's a good idea to see what XML the GetMedia-extension returns.
/Kim A
Kim A, thanks. I'm using umbraco v4.5.2
Ahh didn't see your second reply before I posted my answer (I had opened this post as well as others in several tabs, and took some time before I got to this one :) ).
But did it work for you, or do you stille have the problem?
/Kim A
That fixed my problem! Thanks so much for the help!
Great to hear Bob!
Remember to mark one of the answers as the solution :)
/Kim A
is working on a reply...