I needed to be able to style fieldsets from collapse text separately from other fieldsets on the site. This patch implements the following towards this goal:
- Adds theme_collapse_text_fieldset(). By default, this uses the normal fieldset theming, but it allows themers to do custom theming for collapse_text fieldsets only by overriding this function.
- Adds a 'collapse-text' class to the div wrapping the text content.
- Adds another optional parameter to the tag to specify a "style". This style is inserted as a class into the fieldset, allowing sites to have different fieldsets with different semantic meanings. A fully populated tag might look like:
[collapse collapsed style=features title=Whizzbang features!]I can post a link to a site demoing this in action soon, once we have the content up :).
The options must be kept in this order with title being last to allow for the title to not be wrapped in quotes as it currently is.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 634666_improve_theme.patch | 4.21 KB | deviantintegral |
| improve_theme.patch | 3.87 KB | deviantintegral |
Comments
Comment #1
deviantintegral commentedHere is an updated patch which ensures that the HTML validates by wrapping the fieldset in a form tag. $base_url is used as the action, as we don't want to use drupal_render_form() and cause the fieldsets to actually be registered with submit hooks and the like.
Comment #2
eronte commentedI installed this patch, works flawlessly. Many thanks!
Comment #3
pooneil commentedHi,
Thanks for the patch. I incorporated it (the updated version of the patch) into a new beta version 6.x-2.0-beta1 of the module.
Regards,
Anthony
Comment #4
pooneil commented