Hi, I am trying to create this website and the client would like to have a different background image for every page that fills the page.
Would I create a Snippet, Chunk, or just hard code it in every page? And how would I ensure that it is different for every page?
See www.klarsendesign.com/modx for the visual
Thanks!
-
☆ A M B ☆
- 24,524 Posts
Create an image TV (no output widget selected, so the TV will just output the image filename). Then in the template head put a small <style...> block with something like this:
body {background: url(assets/images/[*bgImageTV*]);}
Or if you prefer, you could use inline css in the body tag:
<body style="background: url(assets/images/[*bgImageTV*])">
Now for each document you can just select the image desired for that page.
Thanks for the simple solution.Even though i didnt understand about imageTV. But i used
<body style="background: url(./images/james_white_ants.jpg) no-repeat">
-
☆ A M B ☆
- 1,780 Posts
Create an image TV in MODX and assign it to the template with the body tag variable as shown. Then, when you edit the resources you'll be able to select a new image for each page with the TV that you made.