1. Is there any ability to apply accordian not to all blocks of right and left regions of my page, but to only one choosen block or for one region left or right?

2. Is it possiable to choose which part of accordian menu will in open state when page open (not only first by default)

Comments

pflame’s picture

1. Is there any ability to apply accordian not to all blocks of right and left regions of my page, but to only one choosen block or for one region left or right?

Presently there is no configuration available to do this. This task is there in our next release plan. Presently this module look for regions with names left and right. If you put different name for your right or left region like left_side, right_side then accordion effect will not applied for those regions.

If you don't want to apply accordion effect for right region just rename your right region with right_side but sure we will provide configurations in the future releases.

2. Is it possiable to choose which part of accordian menu will in open state when page open (not only first by default)

This is also not available now, but you can do this by moving your intended block to first position. This is also there in our next release plan.

Thanks haver for raising these questions so that we put more focus on the next release.

BDS’s picture

Title: Apply accordian effect to single block or region? » Click on the same parent element to collapse accordion block?

Hi, Thanks a bunch for this module, it's great!

Is it possible to click on an expanded parent element and have the block closed / collapsed? Or even somehow to a javascript code to trick the block to open up another block to close the current block? On a large block, it becomes a huge UI problem...

pflame’s picture

Hi BDS,

You can make the block collapsible when you click on the title by using following code in your javascript.

$('#accordion_blocks_left').accordion('option', 'collapsible', true); // for sidebar left blocks
$('#accordion_blocks_right').accordion('option', 'collapsible', true); // for sidebar right blocks

You can activate any of the block using following javascript code

// Activating the block having index 2 means it is 3rd block in the sidebar left.
 $('#accordion_blocks_left').accordion('activate', 2);
// Change the index value to activate intended block.

For more information check this link http://jqueryui.com/demos/accordion/

thf’s picture

Excuse the following newbie question: Where do I place the mentioned javascript code?

Edit:
Sorry, I tried to fiddle around in the "jquery_ui" folder not the "accordion blocks", found out, that i have to manipulate the accordion_init.js
Now it works.

2noame’s picture

This looks like it should work, but for some reason it doesn't. Have tried a lot of variations too. Just can't seem to get the collapsible option set to true.

2noame’s picture

Okay I figured it out. The trick was also activating the alwaysOpen option.

So just add collapsible:true and alwaysOpen:false to your accordion_init.js file.

$('.accordion_blocks_container').accordion({header: "h2", autoHeight: false, collapsible: true, alwaysOpen: false});

Thanks for the great module!

pflame’s picture

Hi 2noame,

Actually Jquery UI accordion blocks widget provides more options. That information is available at http://jqueryui.com/demos/accordion/. Presently I am using the only 2 options, header and autoHeight. I am thinking of providing support to specify these options on the admin interface. I think It is better to provide default option values which apply to all regions and options specific to each region. Thanks for mentioning theme points.

dgdubois722’s picture

$('.accordion_blocks_container').accordion({header: "h2", autoHeight: false, collapsible: true, alwaysOpen: false});

That worked great for me. Now is there anyway you can make them all collapsed until the user clicks on the tab?

raffi’s picture

Try this

$('.accordion_blocks_container').accordion({header: "h2", autoHeight: false, collapsible: true, alwaysOpen: false});
$('.accordion_blocks_container').accordion("activate", false);

vm’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Drupal 6 is no longer supported.