Does anyone know how to insert the current property value (image node id) to get the image to display? Or do I have to use a macro instead of using inline xslt?
You'll have to do this in a custom xslt. Usually it's better writting this in an xslt as you can check if the page property PageHeaderImage is valid or not.
Thanks to both of you. Chris, I took your advice and did it in a macro. We aren't ready to start adding extension projects yet but later I may look at using your inline xslt project..
How would I go about getting an alt attribute within this piece of code. Details for this alt currently sit within an alt item with an alias 'alt text' within my media folder.
I am new to Umbraco and I am trying to get an image in a template. Unfortunately none of the solutions suggested above worked...this is what I have in my template code:
Showing Image from Template using inline xslt
I am just trying to display media picker images from a template it only displays when using hardcoded Node Id:
This works and displays the image:
xslt="concat('<img src="', umbraco.library:GetMedia(1949,'true')/ data[@alias='umbracoFile'], '" />')"
XsltDisableEscaping="true"
But this doesn't (given property name PageHeaderImage for the template):
xslt="concat('<img src="', umbraco.library:GetMedia([#PageHeaderImage],'true')/ data[@alias='umbracoFile'], '" />')"
XsltDisableEscaping="true"
Does anyone know how to insert the current property value (image node id) to get the image to display? Or do I have to use a macro instead of using inline xslt?
Any help would be appreciated!
Thanks,
Mike
You'll have to do this in a custom xslt. Usually it's better writting this in an xslt as you can check if the page property PageHeaderImage is valid or not.
You could always use the inline xslt functionality of http://our.umbraco.org/projects/xsltresult to achieve this directly in the template.
Mike
Take a look at the samples in this book:
http://umbraco.org/documentation/books/inline-xslt
That should get you going :-)
Thanks to both of you. Chris, I took your advice and did it in a macro. We aren't ready to start adding extension projects yet but later I may look at using your inline xslt project..
Hey guys,
I currently have
How would I go about getting an alt attribute within this piece of code. Details for this alt currently sit within an alt item with an alias 'alt text' within my media folder.
Hello guys,
I am new to Umbraco and I am trying to get an image in a template. Unfortunately none of the solutions suggested above worked...this is what I have in my template code:
And that is what is rendered in my browser:
As you can see the field parameter is exstisting but something goes wrong when returning the image url.
Is there anything I am missing?
Thanks
You are probably using the new xml schema, so I think your code should be:
Hope this helps
is working on a reply...