Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Can sections have custom fields like articles do? (FIXED)
I’m building some fairly complex (for me, at least…) location-sensitive code to automatically populate <head>
meta descriptions, keywords, sidebar and titlebar stuff. The net result (which works) is that for individual articles, I use custom fields to populate each of these things and sections have their own forms for the same thing – so I’m effectively emulating the custom fields functionality with misc forms.
I have 4x forms for each section. In the case of default
, they are:
default-meta-description
default-keywords
default-sidebar
default-titlebar
As the number of sections increases, the number of forms increases by a larger amount (one section = four forms) and is becoming more unwieldy as time goes by. My question: is it possible to apply the custom field functionality to sections as well as articles? Either the same fields as defined in admin prefs, or separately, I’m not fussy :)
Thanks in advance.
Pete
Last edited by gaekwad (2009-06-15 14:25:17)
Offline
Re: Can sections have custom fields like articles do? (FIXED)
What about just using four forms, then using if_section
conditionals in the forms? The forms themselves would become rather long, but you wouldn’t have so many of them.
Code is topiary
Offline
Re: Can sections have custom fields like articles do? (FIXED)
@jsoo: ooh, very clever – I never thought of that. Thank you for your suggestion and prompt response!
Offline