Jump to content

Grouping fields within admin


Peter Knight
 Share

Recommended Posts

I was looking for a way to group fields within the admin today and came across this wiki entry which does just that http://wiki.processwire.com/index.php/Template_Tabs

IE have fields nested under certain categories when editing a page such as

General Content (heading/category)

  Summary (nested field)

  Body (nested field)

Featured Content (heading/category)

  Homepage images (nested field)

  Homepage summary (nested field)

I was wondering if there were plans to make this a little more straightforward and perhaps use Categories or Tags.

We already use Tags to group fields on the main fields (admin >setup >fields) and could this be extended slightly?

Link to comment
Share on other sites

Hmm... If you did a category/tagging system or based it on the existing tagging system, you wouldn't be able to customize the order of the fields in different templates. That said, I agree that the fieldset/fieldsetTab system right now is a little bit unintuitive, even if it is quite functional. A fieldset doesn't really "feel" like it should be a type of field itself, and having to setup each fieldset can get a little tiring. I think it would be nice if the fieldsets could just be created and added right from within the template's edit screen.

I've recently started using fieldsetTabs to split off content into "Sidebar" and "Media" tabs, and it really helps to clean up the editor. It's a great feature that I'm surprised I haven't really used before now.

Another thing that I've started to realize could be helpful in PW is some way of grouping fields into portable components that could be added to templates as a single unit (like repeater fields, except without the repeating part), instead of having to add each field one-by-one. Technically, templates ARE linked to "fieldgroups" (if you have advanced mode on, you'll see the option to use a fieldgroup from one template in another), but I don't believe you can have more than one fieldgroup per template.  Anyway, it could end up adding more complexity and confusion to the system, but it could also be a big time saver in some cases.

EDIT: I think if it was setup as new fieldtype similar to repeaters it wouldn't be too confusing. Maybe it's time for me to build a module...

  • Like 2
Link to comment
Share on other sites

I like the system how it is now. I just give tabs names like "_sidebar" to distinguish them from normal fields.

@ivan: Just create a template called "default" or whatever including all the fields you want to use in all templates. Then - when you create a new one - just select "default" in the field which asks you if you want to copy some fields of another template.

  • Like 2
Link to comment
Share on other sites

@Sparrow: not sure if there's any specific documentation for these. FieldsetOpen and FieldsetTabOpen are two of the field types you can choose when you're creating a new field and when applied to a template, you can use them to split one template (in Admin, as these fields rarely have any meaning at template files) into fieldsets and/or tabs. That's all.

Edit: fieldsets are also discussed in the overview video. If you're not familiar with that, the entire presentation is worth watching (in fact it's where every new user should always start from, if you ask me) but here's the specific part discussing fields (including fieldsets).

Edited by teppo
Link to comment
Share on other sites

It would be great to automatically add a tab to all templates (like you can do with fields). This is handy for the SEO tab for example.

Have you tried to make the fieldsettab global as well? I would imagine that this would add it, but the order could be off.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...