Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-21 23:55:41

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

multiple page templates vs. "default" page + if_section conditionals?

Hi all.

Since the day I have discovered the mdn_if_section plug-in (by Remillard), when I was an “alpha” (or maybe a “beta”), I have ever used conditional tags (if_section) and just one page template (default). Right now, I dont use mdn_if_section anymore, because now it’s integrated in the core (txp:if_section). Gloria to mdn_if_section and gloria to Remillard.

I have never created another page template, so all my sections always use “default” page.
That is my natural way of working with TXP.
I cant imagine myself having to go through more than one template if I want to modify slightly the layout (even when using txp:output_form for output the header, footer, etc, menu).
The truth is that I “dont know” how to work practically with various page templates. Of course, I know the theoria but I simple imagine that it’s more difficult to mantain various pages templates. It’s like a prejudice I have.
So, I can only imagine that I’m losing something important, that I’m not using all the power that TXP can give me for not using page templates for anything.

I would like to read opinions from both schools: the “default-template+if_section” school and the “multiple-page-template” school. And also I would like to read if you have any hybrid approach that has any advantage.

Also, I would like to read some “testing results” about the impact in performance of each method.
I know that lot of condinionals are not good for performance, but also isnt good to have too much DB calls. am I right?

Finally, I would like to add some pros and cons of the “default-template+if_section” method.

Pros:

  • just one page template (with all the advantages that this implies).
  • doesnt need to setup in “section” tab, wich page uses each section. All sections use “default” by default.

Cons

  • your unique page template can be a little messy (or a lot messy) with all those if_section tags.
  • you have to think in terms of conditionals tags.

pro? cons?

  • performance impact of using conditionals?

Thanks.

pd: I hope this thread also could be a help for other “alphas” and “betas” that cant decide with method is better for them.

Last edited by maniqui (2005-11-22 16:36:22)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#2 2005-11-22 00:18:23

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: multiple page templates vs. "default" page + if_section conditionals?

If all your pages are exactly identical, no real reason to use more than one page. Usually I have more than one page layout, as in quite a few subtle (and sometimes drastic) changes. I’d rather create a new page than add even more conditionals to a page.

Offline

#3 2005-11-22 01:24:21

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: multiple page templates vs. "default" page + if_section conditionals?

I use a mixture of both. If the layout is similar I go for conditionals and if it is radically different I use a new template. The only exception to this is the default template. It does my front-page and nothing else what-so-ever. Don’t ask me why. I have no idea. It just turned out that way. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#4 2005-11-22 01:54:39

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: multiple page templates vs. "default" page + if_section conditionals?

The only exception to this is the default template. It does my front-page and nothing else what-so-ever. Don’t ask me why. I have no idea. It just turned out that way. :)

I like that approach… One template for the frontpage (“default” template) and another template for internal (section) pages using if_section conditionals.

I would bet that this approach have a good impact in home-page load time.

I think I will put it in practice in the next TXP installation.
Thanks, Stuart!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2005-11-22 06:46:56

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: multiple page templates vs. "default" page + if_section conditionals?

Well that’s 2 things I’ve got right this year then, and still time for a third. ;)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#6 2005-11-22 16:27:41

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: multiple page templates vs. "default" page + if_section conditionals?

I follow the same philosophy and practice as mary and stuart.

Interesting timing on this post, though, maniqui; I’m working on an article which is essentially my own take on TxP semantics and the concept of “article flow”, and it briefly touches upon this issue — Sections-Pages and why you might have a one-to-one or a one-to-many relationship. I mention the default only concept too, but only in so much as it is the out-of-box (blank canvas, if you will) state of a new install, not something people generally stick with. Interesting though.

Last edited by Destry (2005-11-22 16:29:35)

Offline

#7 2005-11-22 23:38:18

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: multiple page templates vs. "default" page + if_section conditionals?

Well it’s not quite the “out-of-the-box” state that I’m using Destry. In a default install your blog uses both the default and the archive templates to separate list-view and individual-view. My default template is stand-alone and does nothing else but display my Home page contents. My blog uses only the archive template for both list and individual views. I’ve written about this over at FreshText.

Last edited by thebombsite (2005-11-22 23:41:30)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB