Adam Kiss Posted April 13, 2011 Share Posted April 13, 2011 Hello Ryan, I've been working with PW quite a lot (I guess), but this one troubles me. What is the intended use for this type of field (Other than showing/hiding group of fields with one click)? Adam Link to comment Share on other sites More sharing options...
ryan Posted April 13, 2011 Share Posted April 13, 2011 That is the intended use. Fieldset will group multiple fields together for editing ease. If you use the FieldsetTab it will place them in a separate tab in the editor (like children and settings). Both can be nested as much as needed. I work on a couple sites that have 50+ fields in a template. So grouping of this sort becomes important. For sites that don't deal with a lot of fields, these fieldtypes will likely not get much use. These fields don't have much use outside of the admin, unless you needed to perform some kind of grouping on the front end. Link to comment Share on other sites More sharing options...
Oliver Posted January 2, 2012 Share Posted January 2, 2012 Got a little question here: I’ve been trying the Fieldset field types in a current template I’m working on. Now when opening the page edit interface, three info messages pop up at the top telling me the first part of the fieldsets name an the encapsuled fields. They all are named like »tab-xy« and »meta-xy«. See attached screenshot. Any idea, what causes these messages? Link to comment Share on other sites More sharing options...
ryan Posted January 2, 2012 Share Posted January 2, 2012 Sorry about that, had an extraneous debug message in the dev branch. I just committed an update that should remove it. Link to comment Share on other sites More sharing options...
Oliver Posted January 2, 2012 Share Posted January 2, 2012 Nothing to be sorry about. Thanks ryan. Link to comment Share on other sites More sharing options...
Godfrey Posted August 30, 2013 Share Posted August 30, 2013 Going to dig this thread up again with another question:Would it be possible to reference fields via Fieldsets? (or something similar since I know right now they don't have much to do with the API)For example, in a template you could set up something like title about_fieldset_start title description about_fieldset_end contact_fieldset_start title description contact_fieldset_end Then reference the "title" for "about" by: $page->about_fieldset->title?I know that currently you can only place one "title" field per template, but it would be helpful if you could place multiple if there were different groups. Because if on a page there were many different disjointed sections (where you can't use repeaters) like "about", "contact", "feedback", etc... right now wouldn't you have to make title field for all of them? e.g. "about_title", "contact_title", "feedback_title"? Or is there a different method I'm missing? Link to comment Share on other sites More sharing options...
diogo Posted August 30, 2013 Share Posted August 30, 2013 There is no different method. The same field can't be repeated on the same page because of how the database is built. The fieldset doesn't take any part on structuring the fields on the database, so you should consider it merely like a cosmetic thing for the admin. Right now, the only way to group fields as you want is the repeater, but I think that in your case the best would be to have independent fields like "group1_title", "group2_title" and edit their labels to read only "title". On the admin side it will be no different from your first idea. 2 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted July 13, 2015 Share Posted July 13, 2015 ... These fields don't have much use outside of the admin, unless you needed to perform some kind of grouping on the front end. Ryan says you can use fieldset for grouping on the frontend, diogo says you can't. Could you please clear things out: сan I get all fields within a fieldset via API from the frontend? If so, how? Link to comment Share on other sites More sharing options...
diogo Posted July 13, 2015 Share Posted July 13, 2015 It is possible, it's just not designed for that. See here https://processwire.com/talk/topic/10226-getting-fields-in-a-fieldset/ 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now