Background image attribute for page elements
Permalink 1 user found helpfulAs an example, I have a home page which has a background image in the header, (set to cover in CSS). Other sub-pages would have a similar header section, with different background images depending on the page and element that is targeted. This has to be user-defined, and not hard-coded into the CSS.
I came across this post which gets me part of the way there, but is only designed for handling the page background, and not a specific element.
http://www.concrete5.org/documentation/how-tos/designers/use-attrib...
I also found this:
http://www.concrete5.org/marketplace/addons/background-image/...
but it is only designed to handle the page background, or a single element across the entire site, which is limiting in my case.
Any suggestions on how to apply image attributes to target multiple specific elements across multiple pages would be greatly appreciated.
I appreciate your help!
With what I said above, the same element (say a header) can have a different background image according to the age it is in. This code will be executed on each page and for each page, the same attribute can have a different value (a different image) so the same element will have a different background.
Isn't it what you want?
Thanks for this!!
The first link you have is really all you need.
In the little piece of code they offer just replace "body" with whatever class or id your element has and the image will be applied to it
so let's say you have a div with a class of "myClass" and another with a class of myOtherClass. you would change the code to be
Now if you want a different image for each element, you have to create as many page attributes as you need images, give them different names and use this code repeatedly. Say you have 2 page attributes my_element_background and my_other_element attribute with the same classes as above