Site logo

Archived topic

collapsible text

3 replies · Started by Anil on May 13, 2020

Viewing posts 1–4 of 4

hi can i add collapsible text with generateblocks?
something q/a or faq or expand/collapse area of text....

Regards

Hi there,

if jQuery isn't a problem then this topic provides a solution:

https://generatepress.com/forums/topic/collapse-button/#post-1194173

If you see the HTML being used you can simply substitute that with a Headline block and a Container Block - each of which you can add the respective Additional CSS Classes ( select the block and you will find this field in the Settings Sidebar under Advanced).

Thanks David, I'll try that.
Initially, that is looking lot of work to do...
It would be better if some plugin must handle all that work...
Regards.

There are plenty of plugins for Accordion / Concertinas. But nothing in GenerateBlocks.
The JS and CSS only needs to be added to your site once.

For the content.
I would first create a single Headline followed by a single Container block, put in some dummy content, style them and add the Additional CSS classes.

Once i was happy i would select both blocks - by shift clicking the two ( Gutenberg can be a little fiddly with this ).

When both are selected you can select Add to Reusable Blocks from the 3 dot menu in the toolbar.

Then whenever you need to add collapisble blocks simply add New Block > re-usable block.
Then From the blocks toolbar 3 dot menu now: Convert to Regular Block so you can edit the content.

You can then duplicate the Headline and Container blocks from the same menu to create a stack of them :)

This archived topic is closed to new replies.