This is a great module. I suggest some additional documentation. I work a lot with the OMEGA theme, imho the best 960/fluid theme avaliable.

As of omega using subtehming (this could also apply to other themes maybe) the config is a little bit different

Make Collapsiblock work with the OMEGA Theme

===============================

To make Collapsiblockwork with the omega theme you have to set the fields to be empty in the global settings like in: http://url.com/admin/appearance/settings
Then make your settings inside the subtheme like: http://url.com/admin/appearance/settings/wiki (wiki is the themename in this case)

Block: section.block
Title : :header:first
Block content: div.content

===============================

ps. is it like that with other subtheming themes too?

Comments

Yuri’s picture

Thank you! I bumped into this by accident, its indeed a must to get this into the documentation. It works, by the way.

technikh’s picture

Thank You so much e-anima.
this post saved me a lot of time.

ibuildit’s picture

if you use the latest version of omega (to date), the second setting is:

h2.block-title, not :header:first

:)

finedesign’s picture

I tried to do this, but my block is still not collapsing. I'm using Omega 7.x-3.0.

I deleted all three fields here: /admin/appearance/settings
Then I added the following to the three fields here: /admin/appearance/settings/mytheme

  • Block: section.block
  • Title: h2.block-title
  • Block Content: div.content

Then I enabled the collapsiblock here:
admin/structure/block/manage/views/myblockname/configure

Then I dumped the cache.

Still no love.

marcoka’s picture

This is working

Block: section.block
Title: h2.block-title
Block Content: div.content

do not add this to the GLOBAL settings, go to your subtheme settings and add it there (omega sub theme)

xaa’s picture

just defined Block: section.block on the subtheme setting made it working with the 7.x-1.0.

thank you!

leducdubleuet’s picture

Thank you, this is a great little module!
Thx for the infos to make it work on Omega!

ñull’s picture

Title: Documentation » Using Collapsiblock with Omega theme

This thread apparently only corresponds to the Omega theme, so I renamed accordingly. Will open another thread for my theme.

manoloka’s picture

5# is working for the Mix and Match theme too

roman_l’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Component: Documentation » Code

Hi all,

as none of the solutions above worked for a collapsible views exposed form in a block,
here is what i did to make it:

- copy the default block.tpl.php in your subtheme 'templates' directory;
- with firebug find the html id of the block you want to make collapsible

edit your custom block.tpl.php file adding an 'if' statement (if the id of our block is the one, then make it collapsible):

<div id="<?php print $block_html_id; ?>" class="<?php print $classes; ?>"<?php print $attributes; ?>>

  <div class="block-inner clearfix">

<?php if ($block_html_id == 'THE-ID-OF-YOUR-BLOCK') : ?>


<?php
drupal_add_library('system', 'drupal.collapse');
drupal_add_js('misc/collapse.js');
?>
<fieldset id="fieldset-id"  class = "collapsible <?php print (count($_GET) == 1) ? 'collapsed' : ''; ?>">
  <legend> <span class="fieldset-legend"><?php print $block->subject ?></span>
    
  </legend>
  <div class="fieldset-wrapper">
  <div class="fieldset-description">Fieldset description you can change</div>

 <div class="content"<?php print $content_attributes; ?>>
    <?php print $content ?>
  </div>
  </div>
</fieldset> 

 <?php else: ?>

  <?php print render($title_prefix); ?>

<?php if ($block->subject): ?>
  <h2<?php print $title_attributes; ?>><?php print $block->subject ?></h2>
<?php endif;?>
  <?php print render($title_suffix); ?>

  <div class="content"<?php print $content_attributes; ?>>
    <?php print $content ?>
  </div>
  
  <?php endif;?>
  </div>
</div>

And voilà !

I don't know why this particular block didn't want to collapse (perhaps the date popup widgets inside?) with collapsiblock module, but here's my quick-and-dirty block override ;)

Hope it helps

darvanen’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Issue summary: View changes
Parent issue: » #1186198: Collapsiblock v2 for Drupal 7

See parent issue.

darvanen’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.