1. I’ve probably phrased the title of this thread really badly, but hopefully my question will become clear from my description..
2. I’m not sure what the intended difference between the
"Development & Coding / Templates" and
"Add-ons, Extensions & Elements / Templates" forums is, so I took a semi-educated guess on the basis that I’m asking about developing my own template, rather than discussing one that is released to the wider public..?
My question:
I’d like to minimise the number of templates that I use as much as possible. I’m developing a site where most, if not all, pages will use the same stylesheets and will have the same general appearance (in terms of colours, fonts, etc, etc) with a header/menubar across the top and main content below. For obvious reasons, I don’t want to have to laboriously replicate this across several templates should the design change in future.
Most pages will also have a second-level menu in a column on the left-hand side (a ’div’), with the content taking up the remaining horizontal space to the right.
However, I’ve identified that some pages (eg, News) will not show the left-hand menu column (ie, that ’div’ and its contents should not be output for pages of this type), and will also use some styles different from the default for parts of the page (using <body id="news">, for example, to identify this).
(There may be other variant types of page to come later, but this is the only other type that I’ve identified for now.)
Would it be possible for me to somehow develop my template so that I could set something somewhere (ideally, just one ’thing’, and I’m guessing that a Template Variable might be the key here?) so that I could identify that a given page would be (for now) either of type "Default" or of type "News"?
Using just this one value, would it be possible to <handwaves> perform some magic in my template so that
both the body id could be set (or not) and the column div could be included (or not), based on the one value?
Or would I need to use two template variables: one to set the body id type, another to include the div (or not)? (This starts to make things more complicated for end users, however..)
Thanks for any advice.