WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • One template, many variations?
  • Print
Pages: [1]   Go Down

Author Topic: One template, many variations?  (Read 4600 times)

flamenco

  • Guest
One template, many variations?
« on: July 08, 2008, 04:16:35 AM »
Hi All,
In the past I've been asked to work mainly with one template, but have many variations. 

For instance, a template might be used throughout a site, but might use different colors on each page, maybe the background color or even just one DIV. 

Another example would be using a different banner image on each page. 

Another system I used had something called Template Variables which allowed this sort of thing very easily, along with many other types of content for each page.  It also supported inheritance, in the sense that if you picked, say, a background color for one page, all pictures underneath it would inherit that color unless you did an override for that page.

I hope that made sense.  I'm enjoying learning about show_menu and version 2 as well, but I haven't yet found a way to do what I'm describing. 

Do any of you know of ways to do something like this?  It would certainly be easier than making 12 very similar versions of the same template, for instance.

As always,
Thanks very much!
Logged

Offline marathoner

  • Posts: 495
Re: One template, many variations?
« Reply #1 on: July 08, 2008, 04:23:49 AM »
If you simply want a way to style any given page (or the child pages of a given menu root parent) different than the default style you could use one of the two approaches in:
https://forum.WebsiteBaker.org/index.php/topic,10249.0.html
Logged

Offline Bramus

  • Posts: 608
  • Gender: Male
    • BRAMUS Internet Services
Re: One template, many variations?
« Reply #2 on: July 08, 2008, 09:31:41 AM »
i'm doing this with a "header" on one site, http://www.marcelissen.nl This is done by an inline stylesheet in the template index.php file with an if else statement.
Code: [Select]
if (PAGE_ID == 1) { .div {background: img(header.jpg)} }
for example.
Logged
BRAMUS Internet Services

flamenco

  • Guest
Re: One template, many variations?
« Reply #3 on: July 16, 2008, 06:09:23 PM »
Thanks for those ideas! 
It seems like PHP code and switch statements will be my friends.  I'm not an object-oriented genius like some of you out there, but I can easily handle this much coding.  :)

It's a bit more manual than the other system I use, but will work perfectly well, and I think this will cover most of what I need. 

To give you an idea of how the other system works, it's possible to set up, for example, and drop-down on a page which has a selection of colors, or a selection of banner images from a folder, either of which would be plugged into the CSS, and that sort of thing.  I'm thinking that this would be a large project to make something like this, though.  But maybe it will stimulate the imagination of some of our better coders here.  :)

Thanks again!

Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • One template, many variations?
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2