Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I would like to load an image from media and use it inline style.
My code (not working):
<body style="background: url(<umbraco:Item runat="server" field="siteBG" recursive="true" xslt="concat(''', umbraco.library:GetMedia({0},'true')/ data[@alias='umbracoFile'], ''')" XsltDisableEscaping="true" />)">
Result: <body style="background: url('')">
<body style="background: url(<umbraco:Item runat="server" field="siteBG" recursive="true" xslt="concat('"', umbraco.library:GetMedia({0},'true')/ data[@alias='umbracoFile'], '"')" XsltDisableEscaping="true" />)">
Result: <body style="background: url("/media/1/2.jpg")">
I think it has to do with xml-escaping...
Perhaps someone could enlighten me - or is it possible to do this?
Site is running 4.0.2.1
/Henrik
Hi Henrik,
I think you'll have to include <body style="background: url()"> into the xslt part of the umbraco item. It won't look nice nor readable, but might work.
Cheers,
/Dirk
Perfect it worked :)
Thanks a lot
/henrik
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Load an image from media and use it inline style?
I would like to load an image from media and use it inline style.
My code (not working):
<body style="background: url(<umbraco:Item runat="server" field="siteBG" recursive="true" xslt="concat(''', umbraco.library:GetMedia({0},'true')/ data[@alias='umbracoFile'], ''')" XsltDisableEscaping="true" />)">
Result: <body style="background: url('')">
<body style="background: url(<umbraco:Item runat="server" field="siteBG" recursive="true" xslt="concat('"', umbraco.library:GetMedia({0},'true')/ data[@alias='umbracoFile'], '"')" XsltDisableEscaping="true" />)">
Result: <body style="background: url("/media/1/2.jpg")">
I think it has to do with xml-escaping...
Perhaps someone could enlighten me - or is it possible to do this?
Site is running 4.0.2.1
/Henrik
Hi Henrik,
I think you'll have to include <body style="background: url()"> into the xslt part of the umbraco item. It won't look nice nor readable, but might work.
Cheers,
/Dirk
Perfect it worked :)
Thanks a lot
/henrik
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.