Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-26 06:01:03

boblet
Member
Registered: 2005-08-08
Posts: 53

[wiki] Doc request: Doing things the TxP way...

Hi All,

I was really impressed with the How do I? common questions FAQ page, and would like to request something similar for “how should I…?” I’m referring to things like:

  • using the same page template for article list and individual article sections, and using <txp:if_individual_article> and <txp:if_article_list>
  • putting code that appears in several places/page templates into forms
  • using conditionals and if/else statements in forms to provide different content per page template or site section/category

I’d be interested in additional ‘best practices’ like these, and also indications on how far to take them. For example, if your site is essentially made up of pages with the same basic parts (header, main content, sub content, footer) it’s possible to just use one page template and do all differentiation via conditionals in forms, even if each page looks very different. But is this increase in conditional statements better than more understandable (although perhaps largely identical) page templates for home, articles, and any special sections? Also I have some forms with 8 conditional statements (for 4 different sections x 2 languages), but I wonder if this is slower than using say one form per section, with 4 conditionals in the page template and then 2 conditionals per form. Looking at the debug output makes it seem like a ton of conditionals in one form is unwieldy (the code processed by TxP is longer than the actual page’s code).

As an aside I’m also interested in what the differences are in the various ways of calling a form (<txp:output_form />, <txp:article_custom/ > and <txp:article />) when combined with individual article and article list views

Btw I know this is on the to-do list, and I know everyone is busy ;-)

peace – boblet

PS ideas for the new TextBook look much better regarding IA – looking forward to it!

Offline

#2 2005-12-02 17:24:54

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

Re: [wiki] Doc request: Doing things the TxP way...

I did an article on separating the front-page from the blog which covers your first point along with a few other things if you want to take a look. In fact there are a couple of other articles there which might cover some of the things you want. FreshText.

Last edited by thebombsite (2005-12-02 17:25:27)


Stuart

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

Offline

Board footer

Powered by FluxBB