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
Hello!
I am using a macro with this piece of code in it
<xsl:value-of select="concat('<div class="mainBlock" ','style="background-image:url({(umbraco.library:GetMedia($currentPage/mainBackground, 0))/umbracoFile});" >')" disable-output-escaping="yes"/>
but it generates
<div style="" class="mainBlock">
instead of
<div style="(background-color:url(some mdia link))" class="mainBlock">
What did I do wrong?
Thanks in advance,
Aleksandar.
Hi Aleksandar,
Try to break it up with a variable for fetching the media, to better check what's happening:
<xsl:variable name="img" select="umbraco.library:GetMedia($currentPage/mainBackground, 0)/umbracoFile" /> <xsl:value-of select="concat('<div class="mainBlock"', ' style="background-image:url(', $img, ');">')" disable-output-escaping="yes" />
Now you can replace the $img variable with a simple string, e.g.: '/media/1234/filename.png' and debug from there...
/Chriztian
Hello, Chriztian.
Thanks a lot. This was the decision.
Regards,
Aleksandar
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
umbraco.library:GetMedia problem
Hello!
I am using a macro with this piece of code in it
<xsl:value-of select="concat('<div class="mainBlock" ','style="background-image:url({(umbraco.library:GetMedia($currentPage/mainBackground, 0))/umbracoFile});" >')" disable-output-escaping="yes"/>
but it generates
<div style="" class="mainBlock">
instead of
<div style="(background-color:url(some mdia link))" class="mainBlock">
What did I do wrong?
Thanks in advance,
Aleksandar.
Hi Aleksandar,
Try to break it up with a variable for fetching the media, to better check what's happening:
Now you can replace the $img variable with a simple string, e.g.: '/media/1234/filename.png' and debug from there...
/Chriztian
Hello, Chriztian.
Thanks a lot. This was the decision.
Regards,
Aleksandar
is working on a reply...