Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2022-09-27 20:17:17

sambooth74
Member
From: Leeds, England
Registered: 2020-11-24
Posts: 20
Website

Scenarios, sections and pages

I’m building a new theme to share with the community. It’ll be a “minimum viable theme” which uses bare semantic HTML and the browser’s default styling. I want it to be a blank canvas so you can add a couple of CSS rules and create a minimal blog or bare-bones personal site. Something like this or this. I am aiming to support all TextPattern features.

Although I’ve used TextPattern to run my personal site for around 2 years now, I still struggle to understand the overall TextPattern model. I have some questions which I think are rather basic.

Here are my proposed sections and pages:

Section Page
default default
articles archive
static static
links links

I am struggling to understand which “scenarios” I need to cater for on each page, and I have tried to reverse-engineer this from the Four Point Eight theme. I would be grateful if somebody could check my plans and confirm my understanding.

Default

  • Front page (as this is never inside a section)
  • Search results article listing (as search is not always within a section)
  • Author article listing (as authors are not within sections)
  • Category article listing (as categories are not within sections)

Archive

  • Section article listing
  • Single article
  • Search results article listing (as search can be within a section)

Static

  • Single article

Links

  • Link listing

All advice appreciated, many thanks.

Offline

#2 2022-09-27 23:47:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: Scenarios, sections and pages

Sounds like your use cases for the Default section are spot on. That’s what I use that section for, and I usually have a dedicated template just to serve it, because it differs from other pages significantly enough to warrant its own handling. But the Page only contains skeleton HTML. Since it still shares elements with other pages, I do farm most of the content out to Forms so the page blocks can be shared with…

Archive. I often call this page Regular or Blog or something like that, because it usually handles most article content, both paginated lists of articles, or individual articles from almost all sections.

Like the Default template, it draws most of its content from shared Forms that I have broken into chunks (head, css, nav, footer, teaser, hero, list_entry, etc) and the Page itself just has skeleton HTML with lots of <txp:output_form /> and <txp:article /> tag goodness to pull in the relevant blocks.

For any pages that don’t fit into the above type, I usually employ a Single page template which is very similar to the above but doesn’t have the pagination nor the list aspects. Any article in that section is displayed directly at the /section URL and is not linked to the individual article to avoid duplicate content. Handy for About and Contact pages. You have that covered with Static.

The only one of your proposed templates I don’t use is the Links page. I tend to let the Regular page handle that kind of thing and use a conditional to switch between article lists and link (or image) lists, if I find it necessary. Usually lists of other content types are just the same as lists of articles, but with a different Form to format them accordingly.

Nothing wrong with splitting them out to their own template though. If you find it easier to manage that way – and think users of your theme will benefit – then go for it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2022-09-27 23:48:36

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: Scenarios, sections and pages

P.S. You’re in Leeds? Snap! If you want to meet up for a pint/coffee at any time, just holler.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2022-09-28 01:42:37

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,091
Website Mastodon

Re: Scenarios, sections and pages

sambooth74 wrote #333919:

I’m building a new theme to share with the community. It’ll be a “minimum viable theme” which uses bare semantic HTML and the browser’s default styling. I want it to be a blank canvas so you can add a couple of CSS rules and create a minimal blog or bare-bones personal site. Something like this or this. I am aiming to support all TextPattern features.

looking forward to “or this”


…. texted postive

Offline

#5 2022-09-28 06:17:56

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,189
Website

Re: Scenarios, sections and pages

You may want to add one (or more?) pages for error pages. There is one error_default that is build-in, but I found it a few times useful to have one for specific errors, e.g. 410 gone or 503(maintenance !). These templates contain a very minimal skeleton structure to display the required messages.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB