Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Multiple templates for different layouts  (Read 1832 times)

danfascia

  • Newbie
  • *
  • Karma: 0
  • Posts: 10
Multiple templates for different layouts
« on: June 19, 2007, 06:12:48 pm »

Hi guys,

I'm keen to code a MOD which would allow a different template.php file to be used for the layout of each category or even article, I'm thinking it can be achieved by adding a new variable column in the DB and new field for each posting that can be assigned. If left blank it could default to index.php

Can someone who knows the codeset better than me a) tell me if this is within the realms of possibility without major reqriting and b) point me to the right zone of the source-code to start tinkering.

Thanks
Logged

centered

  • Guest
Multiple templates for different layouts
« Reply #1 on: June 19, 2007, 06:21:09 pm »

Logged

danfascia

  • Newbie
  • *
  • Karma: 0
  • Posts: 10
Multiple templates for different layouts
« Reply #2 on: June 19, 2007, 06:29:12 pm »

I realise we already have the CSS solution method which has been well documented but is flawed in some ways...

CSS can restructure and hide areas but they must still be loaded by the browser and also the burden on the size of the stylesheet will grow with all of these individual rules.

Example: say I want a header for the category listing section which describes what it is about and has a picture, with the CSS way I would have to have the HTML for every section (in DIVS) in the template and conditionally hide/activate it... that would end up with far too large a template file.

Am I missing something here or is that how the CSS method works?

I'm not just talking about flipping columns around
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Multiple templates for different layouts
« Reply #3 on: June 19, 2007, 06:38:49 pm »

Here is another thread regarding similar issue with some opinions how to handle completely different layouts.
Logged