67 Posts
6 years ago

I have an issue where I am using 2 accordion list templates in a the same Content View. The problem is that the first accordion template conflicts with the second where they both share the same anchor tag id. 

Therefore when you click on the second accordion template's items, it opens up the items of the first.

Get a Book for SEBLOD
67 Posts
6 years ago
Level 1

So I have found a possible solution by manipulating the accordion template's index.php file (located in /templates/seb_accordion/index.php) on line 81 and concatenating the $accordion_id variable in addition to it's loop value ($i).

I believe this should provide enough uniqueness where more than one accordion list won't share the same anchor tag id. 

Here's the following code below for anyone that ends up running into this issue.

$slide=JHtml::_( 'bootstrap.addSlide', $accordion_id.'_accordion', $heading, $accordion_id .'_collapse_' .$i++ );

You will also need to modify the line of code that will leave the first accordion group element active on line 34.

$params = ( $active ) ? array( 'active'=> $accordion_id . '_collapse_0' ) : array();

Get a VIP membership