Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-16 20:38:23

minimal design
Member
Registered: 2006-10-15
Posts: 38

Structure best practice... Any recommendations?

I did read the “Textpattern Semantic Model” article and browsed the forum. But I couldn’t find any discussion on what’s the “best” way to structure your pages and forms. I realize it depends greatly on context, what you’re trying to achieve, and the way you need the content to be organized. It’s also probably a question of personal preference… Or maybe I just don’t get it and there is “one and only” optimal way to do things that will get the best DB performance…

After starting to setup my site with Txp, I came to think about two different ways of setting up your content and I’d like you guys to tell me if one is better than the other, and why ;)

First, I should mention that my site has a somewhat different presentation from one section to the other when articles are in list mode, but similar layout for individual articles.

#Method 01:

What I’m assuming to be the “standard” way: create your sections and create a separate page for each section with forms for stuff like header, footer, etc…

#Method 02

Have one big default page for all sections, including the header, footer, etc… within the page template itself, then adding different sections’ content with conditional statements like <code><txp:if_section name=“section_name”></code>

The second method seems to be easier to make edits for me, since I like to use TextMate as a text editor, I just have to copy+paste one page to make updates, I don’t have to navigate to 4 or 5 forms to tweak stuff around…

Is there a reason why #Method 02 would be a bad way to go about it?

Thanks for any feedback you guys can provide! :)

Offline

#2 2006-10-16 21:13:26

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: Structure best practice... Any recommendations?

I looked through some old threads and found Textpattern Semantics: A General Revelation, Promoting native Textpattern usage, and especially Refing my TXP site to just 1 template. These might have some insight you can use.

For me, it all depends on what I am trying to accomplish in conjunction with the page design. If two pages are exactly the same except for one tiny area that varies by something like section or whether or not it contains an article list that is easily detected (and long time TXP users can tell you that wasn’t always the case) than I will usually look for away to collapse them into a single page with liberal use of the output_form tag. On the other hand, if a page has all sorts of variations, sometimes it just makes sense to have a single page. Many times a combination of these work best (a set of pages within the site use a page design that has enough variation it makes them unique).

Every site I work on has variations due to how I envisioned things working at some point.

Offline

#3 2006-10-16 22:59:43

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Structure best practice... Any recommendations?

I started off using forms to hold common chunks of code like headers & footers then having multiple pages, but have since moved towards method #2 for ease of editing & updating over time… also find it easier to tweak the markup cos u have more context in plain view

but you do end up with a lot of conditionals!

Mary who is a bit familiar with this publishing tool prefers multiple pages, maybe she’s got a moment to weigh in here ;)

Offline

#4 2006-10-17 16:07:19

minimal design
Member
Registered: 2006-10-15
Posts: 38

Re: Structure best practice... Any recommendations?

Thanks for the links, and the feedback… I feel better to know that I’m not the only one going for the “giant default + conditional” style… :)

Not sure why this post got moved though, I wasn’t really asking how to do anything specific. I just wanted to know people’s opinion on the subject, especially those with long time experience w/ the system.

If anyone did some testing (or knows the inner workings of Txp enough to just know the answer) and found speed differences between the 2 different ways, let me know!

Thanks again.

Offline

#5 2006-10-17 16:13:16

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

Re: Structure best practice... Any recommendations?

Hi minimal desgin

you can also check this threads:

multiple page templates vs. default page + if_section conditionals?
Ona page template to rule them all

Actually, I prefer multiple page templates mixed with few conditionals and I also try to keep many things inside forms, to simplify the maintenance.

Last edited by maniqui (2006-10-17 16:15:27)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2006-10-17 18:49:24

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: Structure best practice... Any recommendations?

+1 vote for multiple pages

If you are smart, you keep the recurring bits of code in forms. For me its usually

  • Header
  • Footer
  • Naviation
  • Search Form
  • Comments
  • Section-specific article forms

This way you can update the entire site from one spot. Many times I also place conditionals inside my article forms..most of them are section or category aware and that saves me a lot of coding and maintenance.

Last edited by Ace of Dubs (2006-10-17 18:50:12)

Offline

Board footer

Powered by FluxBB