Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2025-09-03 09:24:54

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

Re: Text asset naming scheme best practice & form wildcards

The downside to form groups is they don’t nest, but as long as you only need one layer of grouping, it might work out.

If you want to get number-order-freaky, name your groups:

0-anywhere
1-pre-html
2-head
3-header

That way (as long as you don’t have more than 10 and have to switch to double-digits) they stay in order in the Forms panel and anyone in future not conversant with your numbering scheme still has an idea of where to find forms that go in a particular slot in the template.

FWIW, you may find being this regimented has a negative impact wrt reuse because if you want to use the same form to render a sitemap in your ‘footer’ as you do in your ‘nav’ you either have to:

  1. Duplicate it in the relevant group. Makes long-term maintenance harder.
  2. Stick it in 0-anywhere. The dreaded “misc”.
  3. Put it in 0-anywhere but add a stub form to both ‘nav’ and ‘footer’ groups that calls <txp:output_form form="030-nav-list" />. Retains logical structure, but has more indirection and is consequently one function call ‘slower’ than either of the previous methods (this being Txp, speed is relative and there’s tonnes of headroom, but still…)

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

#14 2025-09-03 09:29:18

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,459
Bitbucket GitHub

Re: Text asset naming scheme best practice & form wildcards

Bloke, you have this innate ability to make me want to try stuff out. Good job my social calendar is pretty sparse…

Offline

Board footer

Powered by FluxBB