I realize that this post isn't a single issue to tackle. I ended up doing both of these tasks for a site I was working on.

The first was that if I had two paragraphs displayed as accordions in the same page one would get the ui treatment and the others would not.
I changed the id assigned to the accordion item to be the item_id of the paragraph as it was empty using $entity->nid.

I then added a class to target with the js and adjusted the js to do an each against that class. It might not be the best way to handle it but worked for me.

That is all in the first patch.

The second patch can be applied on top of the first adding a "Start Closed" feature to the display settings that people seem to ask for all the time.

Had I more time I would have applied these to the dev version and tried harder to separate them.

Comments

jimmynash created an issue. See original summary.

jimmynash’s picture

StatusFileSize
new4.83 KB

Patch 1 to be applied first to version 1.1

jimmynash’s picture

StatusFileSize
new3.15 KB

Patch two to be applied after the first.

kurt.j’s picture

Verified this works on the latest version. Nice patches! Installed clean. This should probably just be committed to this project. Thanks! Have a peaceful day.

mibfire’s picture

StatusFileSize
new4.82 KB

Verified this DOES NOT work on the latest version(1.1) because it doesn't take the fact into account that "accordion_id" is used on other places too, not just in ".accordion()". So for example when you change the hash it doesn't open the accordion that is supposed to be the case.

I fixed the allow-multiple-accordions-3139221-1.patch.

So the following patches have to be applied in the given order:

  1. allow-multiple-accordions-3139221-1.2.patch
  2. multiple-plus-start-closed-3139221-2.patch
mibfire’s picture

mibfire’s picture