Collapsible Fieldsets in Drupal 7 Nodes

Collapsible Fieldsets in Drupal 7 Nodes

Monday, Mar 12, 2012
After struggling with various adoptions for getting collapsible fieldsets to work within nodes for Drupal 7 I came across a final solution. Make adjustments to template.php (or in a module if you prefer): function THEMENAME_preprocess_html(&$variables){ // This function looks for node 1 and only adds the javascript for this. // However it can be extended in different ways if required if ($variables['node']['nid'] = 1){ drupal_add_js('misc/form.js'); drupal_add_js('misc/collapse.js'); } } In D7 you must also make sure that your legend contains a span with class fieldset-legend, and that your content is contained in a div with class fieldset-description, and that you include misc/form. ...

Read more
jQuery UI tabs inside a Drupal node

jQuery UI tabs inside a Drupal node

Monday, Mar 12, 2012
Following up on my previous post about collapsible fieldsets in drupal 7 nodes I recently wanted to just add some jQuery UI tabs to another node, and taking inspiration from my previous post about collapsible fieldsets in Drupal 7 nodes, made a little few edits to the template.php to achieve this as well. I actually made this to display vertical tabs from jquery ui, which is why the ui-tabs-vertical class has been added to the JavaScript, so if you don’t want that then just remove it. ...

Read more