Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-09-15 03:30:38

BryanA.
Member
From: Maryland, USA
Registered: 2007-08-12
Posts: 101

Where XY Page meets XY Form for custom layout

Catchy title, no? Truth is I only 45% understand what I’m asking. I have a new section, Café. I gave it a new Page that “duplicates” archive. For now, they look the same.

I do finally understand I can author a new post, specify “Override form,” and demand café_listing or whatever I would call it; the layout of this Section is supposed to be incredibly different and requires access to head and nav and body items found in both Page and Form info. (I get the Page is dictated by Section and the Form can be overridden.) But!

How do I avoid having to always check “Override form?” Where does the XY Form get triggered or explicitly called in XY Page to display a layout that differs from other Pages?


Voice Actor – starting up a site for that good book stuff.

Offline

#2 2018-09-15 05:52:02

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,012
Website GitHub Mastodon Twitter

Re: Where XY Page meets XY Form for custom layout

the default form is parsed either from the code you used in the presentation>pages or in the presentation>forms (type article). The default txp installation takes it from presentation>forms>default.

Check the form attribute in the docs


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2018-09-15 07:56:27

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,599
Website

Re: Where XY Page meets XY Form for custom layout

colak wrote #314039:

Check the form attribute in the docs

… and the list_form attribute for the article overview pages (but only on txp:article because it’s context-sensitive, i.e. auto-detects if you’re on an individual article or article list page).

In the docs, it details which form name is used by default when you don’t explicitly set the attribute.

A lot of other txp:tags and plugin tags also have the form attribute (e.g. section_list, category_list …) allowing you break down your code into manageable chunks.

And finally, there’s output_form tag that allows you to bring in whole sections of code, so you can break down your page content into manageable blocks or make your header, footer, navigation and sidebar blocks consistent across all your page templates.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2018-09-16 20:06:21

BryanA.
Member
From: Maryland, USA
Registered: 2007-08-12
Posts: 101

Re: Where XY Page meets XY Form for custom layout

There are so many details I wouldn’t have guessed at that resource. All I knew about was offset – that’s as fancy as I ever got.

Can I take this to mean that form=XY can go anywhere inside the code for the desired Page? Is it recommended I put the tag at the top or beneath the head or any special consideration like that?


Voice Actor – starting up a site for that good book stuff.

Offline

#5 2018-09-16 21:46:37

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

Re: Where XY Page meets XY Form for custom layout

BryanA. wrote #314068:

Can I take this to mean that form=XY can go anywhere inside the code for the desired Page? Is it recommended I put the tag at the top or beneath the head or any special consideration like that?

No, but feel free to experiment :-) You should find <txp:article ... /> tags in your Page and explicitly pass them the desired form: <txp:article form="XY" ... />. Probably not to all of them, but it depends on your page structure, we’d need to see it.

Offline

Board footer

Powered by FluxBB