Jump to content
  • 0

Help With Tree View Page Navigation



In MediaWiki 1.38, I have a Tree View of some Pages with subcategories, etc. created with HTML, CSS and JS based on design from W3 Schools that I'm using for Page navigation.
I load Tree View on Pages from a MediaWiki Template.
JS for Tree View is copied to MediaWiki:Common.js so that it loads for every Page.

By default, Tree View is closed when loaded on Page, and must be manually opened to active page, which is bolded.
Is there a way to modify JS (CSS or HTML) so that on Page load, Tree View opens to location of active Page within Tree View?

I would like a way for users to know where in the Tree they are; if possible, I'm looking for the following (based on W3Schools example) -

Beverages page opens with Beverages menu NOT expanded and Beverages active (bolded, that's the way W3Schools JS CSS and HTML currently works in MediaWiki).

Beverages menu expands to Beverages > Water Coffee Tea
Clicking on Coffee opens Coffee page with Beverages menu expanded only to subcategories - Beverages > Water Coffee Tea with Coffee active (bolded)

From Coffee page, Tea subcategory expands to - Beverages > Water Coffee Tea > BlackTea WhiteTea GreenTea
Clicking on Black Tea opens Black Tea page with menu expanded - Beverages > Water Coffee Tea > BlackTea WhiteTea GreenTea, with BlackTea active (bolded)

Expanding Green Tea and clicking on Matcha opens Matcha page with Beverages menu expanded - Beverages > Water Coffee Tea > BlackTea WhiteTea GreenTea > Sencha Gyokuro Matcha PiLoChun with Matcha active (bolded)

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.