backdrop-contrib / tocbot

Builds a table of contents (TOC) from content headings.
GNU General Public License v2.0
2 stars 2 forks source link

Improvements for fixed position #20

Closed stpaultim closed 4 years ago

stpaultim commented 4 years ago

I think that this module is much more powerful is the user understands how to make the TOC fixed in sidebar. Better documentation and/or defaults on this would be great.

Right now, I don't think you can make it work nicely without custom css. Maybe we could find a way to make it work on a default Backdrop site - assuming that most people would have to customize it anyway. But, at least it would display much better.

Just a nice idea for future.

olafgrabienski commented 4 years ago

this module is much more powerful if the user understands how to make the TOC fixed in sidebar. Better documentation and/or defaults on this would be great.

Good point! I'm leaning towards better defaults, i.e. setting the .js-toc-block class as default value for positionFixedSelector on the configuration page.

olafgrabienski commented 4 years ago

Right now, I don't think you can make it work nicely without custom css. Maybe we could find a way to make it work on a default Backdrop site ...

@stpaultim With the above mentioned .js-toc-block class, there is no need for custom CSS to make the TOC work nicely fixed in the sidebar. Have you tried to set the class? If so and if it doesn't work / look nice, can you provide more information or a screenshot?

stpaultim commented 4 years ago

Do I need to add that class to the TOC Block?

I did not try that yet. I may have a chance to try it soon.

olafgrabienski commented 4 years ago

As far as I know, the class should already be somewhere in the block markup.

stpaultim commented 4 years ago

@olafgrabienski - NICE

Just started over from scratch and copied ".js-toc-block" from tocSelector into positionFixedSelector AND put the tocbot block into the right sidebar (using Basis and default layout Moscone Flipped) and it worked nicely.

I would have had much fewer problems had I tried this configuration first. I don't thin the current README or help text was very helpful in leading me down the "happy path."

I don't have any more time now, but will try to think of specific suggestions on how to handle this later.

stpaultim commented 4 years ago

Maybe the README should include a section on "Suggested Configuration to get Started" with instructions on how to set it up this way, then the user can make changes once they see the power of how it works.

olafgrabienski commented 4 years ago

Maybe the README should include a section on "Suggested Configuration to get Started" ...

Yes, that's a good idea! I'll add something along those lines to the README.

olafgrabienski commented 4 years ago

Keywords for the README: