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.

Comments

deviantintegral’s picture

StatusFileSize
new4.21 KB

Here 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.

eronte’s picture

Status: Needs review » Active

I installed this patch, works flawlessly. Many thanks!

pooneil’s picture

Hi,

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

pooneil’s picture

Status: Active » Closed (fixed)