Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Allow disabling the Subpages/ Table of Contents per page #306

Open
dantefromhell opened this issue Jan 14, 2024 · 2 comments

Comments

@dantefromhell
Copy link

This feature request is proposing to add an option in the Advanced settings of each page that allows to disable the auto-generated Table of Contents/ Subpages section of the page.

Background
A customer is building course material in their wiki and the Table of Contents/ Subpages leads to various visual glitches

  1. The Table of Contents get automatically rendered even if the page contains only 1 Header2 line. Their course structure involves 1 page per section/ learning hence all of their pages contain a superfluous Table of Contents that list one item, pointing to the space right below it.

  2. The Supages overview is rendered above all content of a page and does not allow customization. In this scenario a page that summarizes and helps navigating multiple learning within a week start with an uncommented listing of subpages, followed by the customized guidance and navigation for this section of the course.

The ideal and hopefully easiest solution would be to implement a configuration option to disable the rendering of subpages and table of contents for each page. The option should/ could be choosen as False to not change current functionality.

@dantefromhell
Copy link
Author

This request has become more urgent, so I started digging around

  • Subpages
    If I understand it correctly, these are rendered on the server side in _view_category_index.php, hence the starting point would/ could be to add an option for this in Advanced settings and add an conditional to _view_category_index.php

  • Table of Contents
    This looks trickier. From what I understand, the ToC is rendered via JS in humhub.wiki.Page.js#L64. I'm not sure though how the server could signal the JS to not render the ToC based on config option that works similarly to my proposal for subpages.

@luke-
Any hints/ recommendations/ pointers would be highly appreciated. I'm happy to try myself on a PR.

@luke-
Copy link
Contributor

luke- commented Feb 14, 2024

@dantefromhell From my side, a PR with additional options to hide the sub pages & the ToC would be fine.

Also a fix to hide the ToC if there is only one heading would be useful. Maybe we should create a bug issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants