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

    The site that I am working on has 6 main sections, and each section has several subpages. The design calls for a different header graphic for each main section (the subpages would keep the header graphic of the parent).

    Should I make six separate templates- one for each main section with subpages? Each graphic is placed in the header h2 div as background img. Is there some way to do this more elegantly undecided ?

    I normally don’t ask so many questions, but I stumbled on ModX while in the middle of a project and realized that it was perfect! I installed it locally and remotely with no problems, and am very impressed- Unfortunately, at this point I am on a very tight deadline and am having a hard time with the learning curve in such a short time....so any help or even just pointer to what to read is appreciated!

    Thanks,
    Catherine
      • 7231
      • 4,205 Posts
      use a class to style the background for each sections h2. Then use a TV (template variable) to select the class name. You can use @INHERIT as the default value so that the child pages inherit the class set for the parent. This way you only need to set the parent class for each section.

      In the template it may look like <h2 class="[*classTemplateVariable*]">

      You can get fancy and put the class options in a pull down menu TV so that all you need to do is select it.

      This is the way I would do it...I wonder why I did not do this before grin
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don&#39;t know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Keep in mind that if you use MODx tags in your CSS that it must pass through the parser. This means that you either have a small <style>...</style> section in your template head for these specific items (which is how I do it if there’s only a few), or have your CSS in a MODx document.
          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