I have create an XSLT file and associated macro to display a list of staff. However I can't seem to get the image URL from the image cropper property. It needs to go into here in my xslt file
Thanks for the pointer. Unfortunatley I am still struggling.
When I look at the image in the content section it has the url '/media/1009/mystaffmember.jpg'
In my XSLT file if I use umbraco.library:GetMedia(@id, 0) I get the error 'No media is maching '1090'' (Bit of a typo there!)
Obviously the @id is of the content and not the image. How do I get the image URL? The current()/staffPicture brings it back but with a lot of other info. I need something like current()/staffPicture.src or simailar
If you follow the image url does the image then in fact load in your browser? If not there must be something wrong and it would be a good idea to try and re-upload the image. If it does then it might be an issue with the implementation of the xslt extension (bug perhaps).
And may I ask why you want to attach the image as a background image rather than using an image tag for the rendering?
I am also having issues playing with the XSLT file. If I get it wrong I get a large red warning that takes up the whole screen and I have to go back to the umbraco root in the url as none of the menu items gets rid of it, this makes experimenting with the XSLT file *really* painful :-(
So I think that you should try using Razor instead.If you are new to Umbraco I would also recommend you to have a look on the Umbraco TV some of the videos are free to watch, and some requires that you subscribe to Umbraco TV see plan and prices here: http://umbraco.tv/plans-signup/
Well as Dennis suggest it's worth going with Razor on this one since there is a known bug with the GetMedia extesion in 7.2 - But seems that it should be fixed in the 7.2.1 release though pr. this issue http://issues.umbraco.org/issue/U4-5925
Many thanks. Managed to sort switching to MVC instead of using macros. Here is the code for anyone else that might come across this in the future. This is in my parent template file with child templates underneath of the same document type.
Get URL from image cropper in XSLT file
Hi,
I have create an XSLT file and associated macro to display a list of staff. However I can't seem to get the image URL from the image cropper property. It needs to go into here in my xslt file
I get this currently in the html
Thanks.
Hi Chris and welcome to our.
Have you seen the documentation for the Image Cropper. If not take a look here http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/Built-in-Property-Editors/Image-Cropper, as you can see there is also an example how to use it with XSLT.
Hope this helps,
/Dennis
Hi Dennis,
Thanks for the pointer. Unfortunatley I am still struggling.
When I look at the image in the content section it has the url '/media/1009/mystaffmember.jpg'
In my XSLT file if I use umbraco.library:GetMedia(@id, 0) I get the error 'No media is maching '1090'' (Bit of a typo there!)
Obviously the @id is of the content and not the image. How do I get the image URL? The current()/staffPicture brings it back but with a lot of other info. I need something like current()/staffPicture.src or simailar
Thanks,
Chris
Hi Chris
What version of Umbraco are you using?
If you follow the image url does the image then in fact load in your browser? If not there must be something wrong and it would be a good idea to try and re-upload the image. If it does then it might be an issue with the implementation of the xslt extension (bug perhaps).
And may I ask why you want to attach the image as a background image rather than using an image tag for the rendering?
Looking forward to hearing from you.
/Jan
Hi Jan,
I am using 7.2.
Yes the url displays the image - http://dev.dartvaledentalcare.co.uk/media/1009/juliette-moor.jpg. It is part of the template at http://dev.dartvaledentalcare.co.uk/dentist and the background image style is used there.
I am also having issues playing with the XSLT file. If I get it wrong I get a large red warning that takes up the whole screen and I have to go back to the umbraco root in the url as none of the menu items gets rid of it, this makes experimenting with the XSLT file *really* painful :-(
Thanks,
Chris
Hi Chris,
Okay since you are using Umbraco 7.2 I would recommned you to look at the Razor and try learn Razor. As you can see the Image Cropper in Umbraco 7.2 outputs JSON, http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/Built-in-Property-Editors-v7/Image-Cropper
So I think that you should try using Razor instead.If you are new to Umbraco I would also recommend you to have a look on the Umbraco TV some of the videos are free to watch, and some requires that you subscribe to Umbraco TV see plan and prices here: http://umbraco.tv/plans-signup/
And some of the free videos can you find here: http://umbraco.tv/videos/umbraco-v7/ Other good starting points with Umbraco are http://our.umbraco.org/documentation/Using-Umbraco/Creating-Basic-Site/ and http://24days.in/umbraco/2014/how-to-set-up-an-umbraco-site/
Hope this helps,
/Dennis
Hi Chris
Well as Dennis suggest it's worth going with Razor on this one since there is a known bug with the GetMedia extesion in 7.2 - But seems that it should be fixed in the 7.2.1 release though pr. this issue http://issues.umbraco.org/issue/U4-5925
/Jan
Many thanks. Managed to sort switching to MVC instead of using macros. Here is the code for anyone else that might come across this in the future. This is in my parent template file with child templates underneath of the same document type.
is working on a reply...