I'm trying to use the following to access my pictures via an additional tab on the standard.master page and template, but the images don't show up, I get the "image not found" graphic.
That's because you need to get the image using XSLT. What you get returned is the id for the image so this is not an imagegen issue.
You can fetch the image using XSLT either inline in the template or by creating a XSLT based macro in the developer section. You need to use the GetMedia XSLT extension to do this. You can see some explanation and examples on how to use the extension here: http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
I assume that the himg is a media picker. This returns a media id, so you have to use some inline XSLT if you don't want to use this in a macro. Could you maybe try something this:
There should be a button beneath the posts (But have a look for the button at Kim's post, right :)), which is highlighted in green where it says "mark as solution".
Great to hear that you got it solved Ben. Actually I hadn't tried the code myself, so there could have been a small error somewhere, but I'm glad there wasn't :)
ImageGen Not finding images
I'm trying to use the following to access my pictures via an additional tab on the standard.master page and template, but the images don't show up, I get the "image not found" graphic.
<img src=/umbraco/ImageGen.ashx?image=<umbraco:Item field='himg' runat='server'></umbraco:Item> />
When I try to isolate the issue, I see that after the merger happens, the code is showing as
img src=/umbraco/ImageGen.ashx?image=1226
but that's not the image's name, nor does it find it. Any ideas?
Hi Ben
That's because you need to get the image using XSLT. What you get returned is the id for the image so this is not an imagegen issue.
You can fetch the image using XSLT either inline in the template or by creating a XSLT based macro in the developer section. You need to use the GetMedia XSLT extension to do this. You can see some explanation and examples on how to use the extension here: http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
/Jan
Hi Ben
I assume that the himg is a media picker. This returns a media id, so you have to use some inline XSLT if you don't want to use this in a macro. Could you maybe try something this:
/Kim A
So you're saying the whole line should look like this:
<img src=/umbraco/ImageGen.ashx?image=<umbraco:Item field='himg' runat='server' xslt="concat('<img src="/umbraco/ImageGen.ashx?image=', umbraco.library:GetMedia({0},0)/umbracoFile, '" />')" xsltDisableEscaping="true" /></umbraco:Item> />
? If so, not working, still not finding it.
And yes, himg is a media picker, I apologize for not posting that in the description.
Hi Ben
Take another look at the sample Kim just posted - it does not match the one you posted.
In his example the imagegen stuff is inside the umbraco:item - in yours you have it both outside and inside.
/Jan
Awesome. It's 3am here and I've been staring at this for hours, should've caught that. Thanks sooo much for your help!
Hi Ben
You're welcome. Happy to hear you got it sorted out. Please don't hesitate to ask if you're stuck another time.
And please mark this post as solved :-)
/Jan
Be glad to, where do I do that?
There should be a button beneath the posts (But have a look for the button at Kim's post, right :)), which is highlighted in green where it says "mark as solution".
/Jan
Great to hear that you got it solved Ben. Actually I hadn't tried the code myself, so there could have been a small error somewhere, but I'm glad there wasn't :)
/Kim A
Got it, thanks again!
is working on a reply...