Page 1 of 1

How to add a bg img to a div, different on each page

Posted: Mon Aug 20, 2018 3:41 am
by sage12
Just using HTML and CSS, I would give each page an id (body id="index">, body id="contactus">) and so on, so that I could change the CSS if necesary for individual pages.

I have a #sidebar that contains a #picturediv. I need to put a different image on each page as a background to the text in the #picturediv.

How is this sort of thing done in CMSMS?

Thanks.

Re: How to add a bg img to a div, different on each page

Posted: Mon Aug 20, 2018 2:12 pm
by velden
One rather common way to do this is to use:

Code: Select all

</__body id="{$page_alias}">
Obviously {$page_alias} will be replaced with the alias of the specific page.

Other possibility would be the use of the 'Extra Page Attribute x' attributes (Options tab when editing a page) and https://docs.cmsmadesimple.org/tags/cms ... /page_attr

Re: How to add a bg img to a div, different on each page

Posted: Tue Aug 21, 2018 10:09 am
by Rolf