Creating a hardcoded collapsible menu in an HTML block

Creating a hardcoded collapsible menu in an HTML block

by Frank Black -
Number of replies: 2

The Moodle Navigation block is disabled on our site. I make my own hardcoded menus in HTML blocks instead (ie. fixed links, not generated).

It would be really amazing to be able to make these collapsible. Just three or four top-level parent items, with one level of links under them, which appear when clicked.

The caveat is that I do not have access to the server, so it has to be pure CSS only - no javascript or Jquery.
I found a couple of little CSS menus online, but they don't work with IE.

Thanks.

Average of ratings: -
In reply to Frank Black

Re: Creating a hardcoded collapsible menu in an HTML block

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ouch!  No JS or jQuery, ok, if you did need a bit of JS for the solution you could always use the 'onclick' attribute in HTML.

In reply to Gareth J Barnard

Re: Creating a hardcoded collapsible menu in an HTML block

by Frank Black -


Thanks for your reply. Actually I did finally get a couple of menus working in IE. However, I found out that none of them works very well encased inside the HTML block - the expanding and contracting doesn't work properly, as the block doesn't resize as required.

I'll revisit this again when I have time. It's not a critical problem, and I've still got plenty of those to solve first.