e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
322 stars 214 forks source link

[enhancement] TOC generation #3372

Open lordmythus opened 6 years ago

lordmythus commented 6 years ago

(opps, hit enter which accidentally submitted before making my post)

Idea #2: A feature I'd like to see is automated Table of Contents. This could be a block or whatever that could be put in with shortcode or editor button press. The Table of Contents would pick up the headings you made and make a clickable TOC that you could place at the top of your pages.

This can be done now manually, but an automated shortcode or whatever would save a lot of time. I am rusty on my javascript and don't really trust the TOC scripts out there to not eat my hamster (if I had one).

CaMer0n commented 6 years ago

Thank you @lordmythus . :smile: ! In the interests and safety of hamsters everywhere, we'll need to find a solution for that! When you say TOC, do you mean from the "Pages" tables, or from somewhere else? fyi "Pages" already builds a TOC automatically. You can see an example here in the left column: https://e107.org/developer-manual (this manual is all built with the "Pages" area of e107). It's not 'insertable' as such, but it can be placed on a theme's layout.

lordmythus commented 6 years ago

@CaMer0n that example on the developer manual page is a good example of a table of contents, though it is not in a mobile friendly place (ie, doesn't show up at all mobile - at least on my pretty standard phone). The table of contents would pull off information from the page and while it would be ideal to not have it as a locked feature of a module (pages) but usable in articles and such as well, that would at least be something.

I note you say it isn't insert-able but can be placed on a theme's layout. Can it be placed on a theme's layout to show up on the page itself and not on the left, and could you explain or direct me to doing so?

lordmythus commented 6 years ago

Also, you might want to consider adding the overflow-x: auto to your tables css. It would make pages like that with a lot of tables far more mobile friendly. On my page i have a declared css, wikitables, that I use with the tables like that, so that other things that use tables like forums aren't messed up by any css I apply to them.