Multiple accordions in separate blocks

Hi,

I'm posting this here rather than making a ticket, in case it is helpful to others.  What is the trick to getting a different ID assigned to each dexp-accordion when they are added to a page in separate blocks, separate regions?  For instance, I have a block in top content that has an accordion, and further down I have a block in bottom content with an accordion. Only the first one works, and I assume this is because the second one has been assigned the same ID by the system.  The second accordion is given this ID: #dexp-accordion-item, which is the same as the first instance.

Thanks!

Diane


 

Hi Picturina,

Thank you for your reporting. Please follow step  below to resolve the issue:

1. Replace #dexp-accordion-item by a dynamic id:

Open accordion.inc file (under sites/all/modules/drupalexp/modules/dexp_shortcodes/includes folder) then replace this line

$vars['accordion_wapper_id'] = drupal_html_id("dexp_accordions_wrapper");

by

$vars['accordion_wapper_id'] = drupal_html_id("dexp_accordions_wrapper_".$_SERVER['REQUEST_TIME']);

and

$vars['accordion_item_id'] = drupal_html_id("dexp_accordion_item");

by

$vars['accordion_item_id'] = drupal_html_id("dexp_accordion_item_".$_SERVER['REQUEST_TIME']);

2. Clear cache

Thanks!

Looks like that will work!  I'll do that today. Thank you so much for your help!

FYI... I'm using accordion to give me  smooth-opening "read more" for homepage text that is too long.  I couldn't find shortcode for a read-more reveal, but by restyling accordion it should work just fine.  It occurs to me it's a feature you might want to include in future themes.

Thanks, Picturina.

Thank you for your information, we will check it then update the demo asap.

Thanks!

Hi, 

I looks like an error is being generated.  It doesn't stop the site from working, and the accordions are both working now, but I'm sure the error it needs fixing.

  • Call to undefined function dexp_shortcodes_accordions_theme()sites/all/modules/drupalexp/modules/dexp_shortcodes/dexp_shortcodes.module:65
    a few seconds ago
    CALL STACK
    # Function Location 1 Backtrace too big to show. -:-

That looks like it was my error.  It seems to have ironed itself out when I retransferred the updated file.