[eluser]Sven Delle[/eluser]
Hi,
I've been thinking about this for some time now; I seem to have a hard time getting the real benefit of templates in my case (actually all cases, as I seem to have a certain way to go about things). I find it hard to adapt to the page - template thing.
Scenario:
I have
n number of pages stored in a database (let's say
n is 2,345 in this case).
These pages ALL use the same template, apart from 37 of them - who use a different template. Or just to make things even worse let's imagine that 28 of the pages use one template, 263 use another, 518 use a third an so on ... you get the picture.
Now, the problem is; I can't seem to figure out how to go about this without either creating a huge for loop or switch checking for like something like an id to feed the content to the right template ...
I'm looking for a clever way to link database content to a certain template.
Using the example above: All pages use ONE template, apart from one page who has a form in the middle of all the the text.
Now, I could create a view with a form. Check for that pages id, and feed the view. But this would very quickly become way to hard to maintain.
I'm thinking of atomizing all data into chunks; a text chunk, a form chunk, a video chunk, another text chunk etc. And then represent a page by an array of chunk id's. And build a page on that data. That way I'm totally flexible in terms of what a page can contain. And I would only need ONE template - which would simply be a view.
Now, someone out there MUST have had needs like this. I'm very eager to hear ANY thoughts going in this direction.
Anyone? Or am I the odd lunatic ...