Collapsible code block with Free plan?
-
Hi,
I am currently working on a pedagogical website with a Free plan.
On the exercise page (https://mixedmethodstitanic.wordpress.com/exercise/), I present 2 syntaxes (for R and SPSS) in 2 blocs, so that users can copy/paste the syntax they need. It takes a lot of space and I was wondering whether and how I could:
– add a sort of collapsible code bloc for each one, so that users can open and close it
– use a “copy/paste” function so that users can easily copy the syntax without manually select and cmd+SRemember that I don’t have a Premium account :(
Thank you very much for your precious help!!
The blog I need help with is: (visible only to logged in users)
-
Hi,
add a sort of collapsible code bloc for each one
See the Collapsible Content (Accordion Effect) section of the Advanced HTML support page.
use a “copy/paste” function so that users can easily copy the syntax without manually select and cmd+S
I don’t know of any code for that, so I’ll call for staff attention. Staff will respond here.
-
Hi there,
The
detailstag for collapsing content cannot be used on the Code block.Also, the automatic copy function will requite code (JavaScript) which is not allowed on the Free plan.
-
Thanks for the help! I took the word “code block” to mean a block of code, not specifically the Code Block for the block editor. Also I forgot that Advanced HTML support page pertains only to the Classic Editor (and the WP-Admin editor as well).
-
Hey!
Thank you so much for your help.
I managed to create an accordion effect, thank you very much. But it ruined the code (you can have a look if you want, under “2. Exploratory quantitative data analysis” on https://mixedmethodstitanic.wordpress.com/exercise/).
I’ll see what I can do.
No worries for the copy/paste function, guess I’ll have to switch to Premium eventually… O.O
Best
-
Never mind, I realise I just need to ad
- in between the lines of code!
It’s going to be great, thank you so much!I’m a beginner in WordPress :)
- The topic ‘Collapsible code block with Free plan?’ is closed to new replies.