I have 4 images I am using to try to display an image inline. (Code Below). I just upgraded to 4.5.2 today. this code did not exist prior to the upgrade. It's new content for our website.
The field names are spelled correctly. double and triple checked.
I tried hard coding the first link to no avail and you will see on the other three links are using the field names.
One avenue I am walking down is whether XSLT needs to compile? If so what would stop the inline code from compiling just in time. ANY HELP WOULD BE AWESOME... I am at a loss.
Thanks for the Reply!... I made the changes you outlined, thanks for identifying the error in my syntax. It is still not rendering anything in the img tag.
That code should work, I just tested on my end and it's fine. You mentioned you just upgraded to 4.5.2 - can you try resaving one of the images that's not displaying? There was a recent issue where images needed to be republished after an upgrade before they would show up.
Inline XSLT not rendering image in Template
I have 4 images I am using to try to display an image inline. (Code Below). I just upgraded to 4.5.2 today. this code did not exist prior to the upgrade. It's new content for our website.
The field names are spelled correctly. double and triple checked.
I tried hard coding the first link to no avail and you will see on the other three links are using the field names.
One avenue I am walking down is whether XSLT needs to compile? If so what would stop the inline code from compiling just in time. ANY HELP WOULD BE AWESOME... I am at a loss.
Thanks, Chris
<asp:ContentPlaceHolder ID="mainDefault" runat="server">
<div class="smallGalleryImage">
<a href='<umbraco:Item field="featurelink1" runat="server"></umbraco:Item>'>
<umbraco:Item runat="server" field="featureimage1" xslt="concat('<img src="',umbraco.library:GetMedia(1911, true())/umbracoFile, '" />')" xsltDisableEscaping="true"/>
</a>
</div>
<div class="smallGalleryImage">
<a href='<umbraco:Item field="featurelink2" runat="server"></umbraco:Item>'>
<umbraco:Item runat="server" field="featureimage2" xslt="concat('<img src="', umbraco.library:GetMedia({0},false())//umbracoFile, '" />')" xsltDisableEscaping="true" />
<a>
</div>
<div class="smallGalleryImage">
<a href='<umbraco:Item field="featurelink3" runat="server"></umbraco:Item>'>
<umbraco:Item runat="server" field="featureimage3" xslt="concat('<img src="', umbraco.library:GetMedia({0},false())//umbracoFile, '" />')" xsltDisableEscaping="true" />
<a>
</div>
<div class="smallGalleryImage">
<a href='<umbraco:Item field="featurelink4" runat="server"></umbraco:Item>'>
<umbraco:Item runat="server" field="featureimage4" xslt="concat('<img src="', umbraco.library:GetMedia({0},false())//umbracoFile, '" />')" xsltDisableEscaping="true" />
<a>
</div>
</asp:ContentPlaceHolder>
Hi Chris!
If I compare your code with the wiki page with the example of inline xslt with the new schema I can see a difference:
Your code:
<umbraco:Item runat="server" field="mediaItem" xslt="concat('<img src="',umbraco.library:GetMedia({0},false())//umbracoFile, '" />')" xsltDisableEscaping="true" />
The example:
<umbraco:Item runat="server" field="mediaItem" xslt="concat('<img src="',umbraco.library:GetMedia({0}, true())/umbracoFile, '" />')" xsltDisableEscaping="true"/>
You use false insteas of true and theres two slashes before umbracoFile.
Can this be the issue?
Im referrering to this page:
http://our.umbraco.org/wiki/reference/templates/umbracoitem-element/inline-xslt
Thanks for the Reply!... I made the changes you outlined, thanks for identifying the error in my syntax. It is still not rendering anything in the img tag.
Here is the HTML output I get from the code.
Hi Chris,
That code should work, I just tested on my end and it's fine. You mentioned you just upgraded to 4.5.2 - can you try resaving one of the images that's not displaying? There was a recent issue where images needed to be republished after an upgrade before they would show up.
-Tom
If that does turn out to be the issue, you can visit hte following URL to republish all media:
Also, it might be cleaner to use a generic macro for inserting the image instead of inline xslt. Simple example here
Thanks Tom!
I will give it a try.
Thanks
Chris
Hi Froad
Your inline XSLT worked great for me, thanks!
is working on a reply...