block.tpl assigns the 'accordion' id to every block, which is not valid markup. The accordion javascript also assumes that there is just one block present.

Comments

matt2000’s picture

To clarify, the initialization of the accordion javascript assumes only one block. The AccordionList function itself works just fine with as many accordions as you like. So it's just a matter of assigning unique ids to the blocks, and fixing the init code in template.php to loop through all of the blocks and build a complete list of IDs to pass as an array.

atrasatti’s picture

Assigned: Unassigned » atrasatti

Hi Matt,
thank you for reporting this, I will look into it and hope to have a fix by next week.

mitomac’s picture

Also following this issue. Matt2000, do you have a patch to fix the problem in template.php?

atrasatti’s picture

Status: Active » Needs review

This should now be fixed in CVS. You can see the changes here: http://drupal.org/cvs?commit=367950

If you are happy enough I will include it in the next release, maybe on Thursday.

matt2000’s picture

Status: Needs review » Reviewed & tested by the community

This works. In my own solution, I did something similar, but I used the array syntax for AccordianList. So:

		$accordians = '';
		foreach($block_list as $block) {
		 $accordians .= "'accordion-{$block->module}-{$block->delta}', "; 
		}
		$inline_script = $vars['inline_scripts'] = '
		function init() {
		    var myAccordionList = new AccordionList(['. $accordians .']);
                    //etc...'

Not sure if that's a meaningful optimization, and it sure makes for ugly quoting, though nicer JS in the end, IMO. Anyway your solution is certainly good enough, so it gets my RTBC.

atrasatti’s picture

Excellent and your implementation also looks easier, I'll release later this week an update.

atrasatti’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in 1.3

Status: Fixed » Closed (fixed)

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