We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4179
    • 33 Posts
    Hello

    I need to be able to set images as backgrounds within the content section. They are quite plain images that will need to be able to have other images shown over the top of them as well. is this possible to do? the idea is to be able to vary the background of the content area, basically, using different images on each page.

    many thanks

    richard
      • 11076
      • 159 Posts
      Quote from: brutus_1 at Dec 28, 2010, 07:51 AM

      ..the idea is to be able to vary the background of the content area, basically, using different images on each page...
      I don’t know if i understand for sure what do you mean, but..

      You can warp [[*content]] within a div with assigned id or class and set a background image using CSS
      Or directly using an Inline style defined with a TV for the particular document:
      	<div style="background-image:url('[[*contentBG]]');">
      		[[*content]]
      	<div>
      

      if you ment some kind of inside content multi-background-templating for several different elements you need to specific which so we can get some grasp on the inside structure to know what is the best way to approach this.

      hope i’ve been an assistance.. gl smiley
        Michael Shraibman( gOmp)  | Freelance Design & Development | wink  impossible is nothing...
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        You can also set an ID for each page’s body tags, perhaps using the resource ID, such as
        <body id="page[*id*]">

        Then your css can set the backgrounds for the content area according to the body tag’s ID.

        I would prefer to use a small style block in the template head, setting the background image for the content area according to a TV, or again using the resource ID as part of the image name.
        <style type="text/css">
        #content{background:url(assets/templates/mytemplate/images/page[*id*].png);}
        </style>
        
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org