Repository navigation
Folder-browse sidebar with pinned Edit Nav links, via Body HTML Injection #8129
djlongy
started this conversation in
3.x - Guides
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Wiki.js 3 has no sidebar mode that renders the page tree (background in #6573). Until it does, this is a workaround that runs entirely from Admin > Theme > Body HTML Injection. You paste it once, and after that everything is maintained through the normal UI:
override/hidemodes.A page named like its folder (
computebesidecompute/) is shown as that folder's own page, which matches how v2 named folders.I'm aware this isn't the prettiest or most elegant solution. I'm sharing it as a suggestion of what a more refined, native version could look like, rather than as something finished.
Caveats
GET /_api/sites/<id>/tree, the.sidebar-navand.w-drawerclass names, and the Vue router on#app.__vue_app__. If any of them move, the script falls back to the stock menu instead of breaking the page.3.0.0-beta.655. Opening any page with?navdemoonce adds a fake four-level folder with 50 entries per level to check how it behaves at depth (its links 404).?navdemo=0removes it.The
CFGobject at the top of the script holds the options (folders first, sort key, counts, follow-page, width limits).Body HTML Injection (click to expand)
All reactions