Polls within Hide details

Ooh, I know the answer to this one. :slightly_smiling_face:

It’s because you need the poll code to be on a line all by itself. You can mix html hide details and the discourse poll code to get the results you want:


<details>
<summary>
Hidden Poll
</summary>

[poll type=regular results=always chartType=bar]
* Option 1
* Option 2 
[/poll]

</details>

Example:

Hidden Poll
  • Option 1
  • Option 2

0 voters


Edit: After my giddy rush of excitement at posting my first message I’ve gone back and had a look at what happens with the standard hide details, as you can definitely put the poll in with white space above and below.

For some reason it mixes the [/poll] and [/details] codes together at the end. No idea if this is desired, but the workaround above works if you need it. :+1:

3 Likes