Hi
I would like to add a background image to my template.
Because I want to create background images on various templates, I would like to use a Macro.
In my document type I have a propertie = addBgImage, Type = Media Picker.
I would also like to test if the user have added a images on the page.
What I have so fare is this:
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{ if (CurrentPage.HasValue("addBgImage")){
var urlImages = Umbraco.Media(CurrentPage.addBgImage).Url;
style="background:url(@urlImages);"
}
}
Background images om template
Hi I would like to add a background image to my template. Because I want to create background images on various templates, I would like to use a Macro. In my document type I have a propertie = addBgImage, Type = Media Picker.
I would also like to test if the user have added a images on the page.
What I have so fare is this:
Hope that you can help me :-)
Hi Kate,
What if you do something like this
Hope this helps,
/Dennis
It did not work This is what I get ind the html code
when I write it like this:
it works fine. But I want to be able to just use the style="background:url(...);"
Hi Kate,
Try this:
Hope this helps,
/Dennis
Thanks Dennis
It works perfect :-)
is working on a reply...