Closed (won't fix)
Project:
Flag
Version:
6.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2008 at 23:03 UTC
Updated:
29 Sep 2010 at 11:06 UTC
Can you set the default flag fieldset to be collapsed please on node input forms?
I have multiple flags that are not neccessary on first glance, and having the default be open takes up a lot of space. Thanks!
Comments
Comment #1
mooffie commentedThe short answer: You can implement hook_form_alter(), in a custom module, to change anything in that fieldset (e.g., title, weight, collapsibility). The is a general question which isn't specific to this module.
I'll soon write a handbook page explaining this.
Comment #2
mooffie commentedYou marked this a "feature request". I'm not sure there should be a feature that makes the fieldset collapsed, or not collapsed, because different admins will want to change other attributes of this fieldset (e.g. title, weight), so it won't be "right" to have a feature that sets only one attribute and ignores some others.
Comment #3
mooffie commentedBTW, it's a pitty there isn't some sort of a "form tweaker" module that would solve all these needs.
But, considering new modules are born each day, maybe there's already such a module. Is anybody aware of one?
Comment #4
mooffie commented(Note to myself: take some code from #262660: Customize "Show on node edit form" for that handbook page.)
Comment #5
mooffie commentedPerhaps it should be a feature after all (plus, changing the fieldset title).
Comment #6
Flying Drupalist commentedThanks, I marked this as a feature request because I think the fieldset should be collapsed out of the box. I worked around the problem by disabling a lot of the flags in the node input form, through the flags option.
Thanks for this great module.
Comment #7
cglusky commentedmooffie,
I am in need of this feature plus changing weights on a form that has several CCK fields. The Flag ends up prior to my last field group. I will code around it for now but had a thought while using CCK - What if you provided a couple tabs like CCK does with Manage Fields and Display Fields when editing a content type? Call them something like Manage Flags and Display Flags; very original I know.
Another option would be to create a dependency on CCK if you wanted to leverage the widget and formatter framework to allow for custom Flag weights, fieldgroup settings and labels. Then you would just use Manage Fields and Display Fields to get'r done, but not sure you want to go there.
R,
Coby
Comment #8
quicksketchA note regarding CCK and settings weights: for the Drupal 6 version we certainly should implement hook_content_extra_fields(). This will allow us to place the Flag fieldset wherever we want by visiting admin/content/node-type/x/fields. This is similar to how CCK lets you move around the Menu settings fieldset on the node form, despite it not being part of CCK. However, it still won't create the option to collapse the fieldset.
Forming a dependency on CCK isn't necessary, it'll just be an added bonus that CCK lets you rearrange the Flag fieldset if it is enabled.
Comment #9
mooffie commented(I agree that we should implement hook_content_extra_fields(). Incidentally, the last time I checked, CCK allowed to "manage fields" only if there was at least one CCK field defined for that node-type. I hope they changed that.)
(Nobody knows of a "form tweaking" module?)
Comment #10
cglusky commentedthanks for the work on this mooffie and quicksketch.
just for some context http://drupal.org/node/203957 is the cck issue that got things rolling for hook_content_extra_fields()
and btw manage fields does get added to the op for content types even if you do not have a cck field in the node type. which makes sense to me because they are using that interface to allow initial creates.
some other notes fyi: after making a rather long form with CCK i started to see weight issues with
-Notifications was hard coded (10?)
-CAPTCHA (inline Admin -10 again?) but CAPTCHA actually uses a function to find the weight of the submit button to know where to add the user CAPTCHA
so it seems making hook_content_extra_fields() more widely used may get drupal closer to a universal form tweaker via manage fields?
i could not find a form tweaker mooffie - it looks like there used to be a project with that name in the 4.x days.
it would be nice to have a central place per content type to manage this stuff. might be bit OT but I am not sure. why not integrate Flags UI into the content type admin like CCK did? just a thought - i have a tendency to throw crazy stuff out there and see what sticks:)
either way i am digging Flags - got to love such a simple concept that creates so much power.
Comment #11
quicksketchInterestingly we *do* already provide settings on the form for editing each content type to set the default value of the flag on the node form. Perhaps it'd make sense to include the "Collapsed" option here. Seems like a reasonable request, though I agree that it's not ideal. Hopefully we'll see a better approach to managing such forms in the future.
Comment #12
pcave commentedI'm trying to move the flags fieldset because it is displaying in a terrible location on my node edit form. However it's not even in the field array when I try to alter the form using hook_form_alter.
Comment #13
cglusky commented#9
I found this when looking for filters. It is a bit of a form tweaker. Never uses it so not sure how well it works. And it may not address the filed set issue.
http://drupal.org/project/formdefaults
Comment #14
malc_b commentedIsn't this already the case? In the field configure you have the options of fixed, collapsible or collapsed. On the display fields tab you can set the same for the node view or different.
Comment #15
jenlamptonWhile we're requesting features, is it possible to request the absence of a fieldset altogether? I want the checkbox to look like all my other cck checkboxes to the user.
Jen
Comment #16
mooffie commentedI'm closing this issue because:
- It was answered already: use hook_form_alter(). Here's an example:
http://initsix.co.uk/content/collapse-or-expand-drupal-6-fieldsets-default
- The problem isn't specific to Flag.
- The Vertical Tabs module is an attractive alternative to fieldsets anyway, and Flag supports it.
This is a very different request. Open a new issue if you're still intereseted.