Is it possible to collapse the topic sidebar?

  • 12 June 2024
  • 2 replies

Our topics tend to be wordy and include lengthly samples of code. Users have asked if we could include an arrow to collapse the right sidebar, freeing up the space to make posts easier to read.


Has anyone created this type of functionality?  


Best answer by rhall 17 June 2024, 13:26

View original

2 replies

Userlevel 4

You can do this with some javascript….but I haven’t done it myself.

The sidebar class you will need to update the styles for is….



display: none; the style will hide that.

The main post section can have its style changed using this class path…


Changing the width from this….

width: calc(100% - 384px); this….

width: 100%;

...will increase its size to replace the space left by the sidebar.

To do this you will need to create a button, checkbox or something else to trigger the change.  The Javascript you will need to add can go in the “Third Party Scripts”.

As I said, I haven’t actually done this (I might give it a go though, as it is a nice idea), so can’t give you the code at the moment. 

Thanks @rhall - I’ll give it a try and let you know.