Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-06-10 16:52:14

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

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

#2 2009-06-10 17:05:52

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#3 2009-06-10 17:08:52

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

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

Board footer

Powered by FluxBB