Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.11.4 (build 3133) - 25 May 2021 (please see announcement regarding releases since 3.5.0)
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

beteljuice new MX Menu Disconknobulator Mk2

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
User avatar
beteljuice
Posts: 3212
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

beteljuice new MX Menu Disconknobulator Mk2

Post by beteljuice »

You like the mx template but are bemused and confused by all the scary stuff that creates the menu ?
Cry no more - behold


The beteljuice Menu Disconknobulator Mk2 :groan:#

Edit: Now updated to handle new separate menu.js type file.

This has two three levels of functionality ...

a) It allows you to have instant visualisation of any layout tweaks or language change without to-ing and fro-ing between an editor and the source script.

b) If you like your new layout, It produces the code necessary to cut-n-paste into the source file, thus reducing the risk of errors.
(or you could just save the code to do further edits later)

c) * NEW * You can upload your existing or work in progress menu for editing.

You can change the order of the links ('narrow' menu order is tied to the main menu)
You can create / edit / remove a total of upto 20 single links and 6 drop-downs with 6 links.
Main menu and 'narrow' can have different links (In the example main menu has drop down for multiple other links, whilst the 'narrow' menu does not - but it does have a single link to the forum instead)

Usage:

First of all if you have not already made a back-up of your js/menu.js do it NOW
To change the menu order just grab a Main Menu link and drag it side-ways (In the case of a drop down you have to grab one its links).
Input should be obvious, just check boxes and text (which update visually on any change).
When you create a link please put something in the url, if only a ? or <space> ;)
For a link to open in a new window just put * in front of the title name.

If you would like to use the menu just scroll down to the big grey box, this contains the code to generate the menu.
For ease of use there is a "Copy To Clipboard" button - press it :o
the beteljuice recommends creating a .js file eg. mymenu-[date].js
You can tell setpagedata.js which menu type file to use.

This code is to create a menu type .js file.

That's all folks ...

It's just javascript, no php devilry. So if you want a copy for yourself just copy the page and put it in your newmx directory.

BTW: If you would like an easy way to apply a different colour theme across your site without having to edit all your pages ...
Just add to the bottom of your menu file:

Code: Select all

	$('head').append('<link rel="stylesheet" type="text/css" href="css/themename.css" />');
Naturally the theme name must exist ;)
Last edited by beteljuice on Wed 28 Apr 2021 9:24 am, edited 7 times in total.
Image
......................Imagine, what you will KNOW tomorrow !

water01
Posts: 2164
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: beteljuice new MX Menu Disconknobulator

Post by water01 »

Very clever, well done!! :clap: :clap: :clap: :clap:
David
Image

NeilThomas
Posts: 59
Joined: Thu 11 Oct 2012 9:51 am
Weather Station: Davis Vantage Pro2
Operating System: Raspberry Pi 3
Location: Gloucester
Contact:

Re: beteljuice new MX Menu Disconknobulator

Post by NeilThomas »

beteljuice wrote:
Wed 10 Mar 2021 3:00 pm
the beteljuice is a little under the weather ATM, so I'll flesh this post out later ..

You like the mx template but are bemused and confused by all the scary stuff that creates the menu ?
Cry no more - behold

The beteljuice Menu Disconknobulator :groan:

I'll do a write up later ....
Very impressive. :D This would actually be very useful in any site using w3 schools styles. Just to give you some more work, how about the option to output as straight html rather than strings in a javascript. It is possible to use Ajax to load the menus rather than have them embedded in the script.

I'll be definitely liking to this anyway. Well done.

Neil.
Neil Thomas
website: oaktreewebs.co.uk | Davis Vantage Pro II | CumulusMX, Raspberry Pi 3b+ | MX build 3133

User avatar
beteljuice
Posts: 3212
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: beteljuice new MX Menu Disconknobulator

Post by beteljuice »

@ALL
First post now carries explanations.

@Neil

Thank you for positive response ...
... output as straight html ...
Edit: Redundant with Mk2 but it basically is, all you have to do is remove ' from the start of each line and ' + from the ends.
The only other thing is the last line of the main menu where onclick="toggleMenu(\'Main_Menu_Mobile\')" needs the \ removing.

EDIT: Do you mean like this ...
It is possible to use Ajax to load the menus
Do you mean from a separate menu file ? - simple answer, yes and this may be a good idea anyway to stop custom menus being over-written on script updates.

Naturally I would like to see the format (element substitution) maintained, but I suspect Mark would prefer JSON wizardry :geek:
Last edited by beteljuice on Wed 07 Apr 2021 4:07 pm, edited 1 time in total.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
beteljuice
Posts: 3212
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

update: beteljuice new MX Menu Disconknobulator Mk2

Post by beteljuice »

Now the beteljuice new MX Menu Disconknobulator Mk2

Allows create / edit / delete of new menu.js style introduced in mx version 3.10.3

Added ability to upload existing or work in progress menu type file.

Link as per first post.

Edit: Also read the BTW at the bottom of that post ;)
Last edited by beteljuice on Mon 22 Mar 2021 2:11 am, edited 2 times in total.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
ConligWX
Posts: 1266
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2 Plus w/DFARS
Operating System: Ubuntu 20.04.2 LTS - NUC
Location: Bangor, NI
Contact:

Re: update: beteljuice new MX Menu Disconknobulator Mk2

Post by ConligWX »

beteljuice wrote:
Sun 21 Mar 2021 10:52 pm
Now the beteljuice new MX Menu Disconknobulator Mk2

Allows create / edit / delete of new menu.js style version introduced in mx version 3.10.3

Added ability to upload existing or work in progress menu type file.

Link as per first post.
:clap:
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir PA-II-SD • CumulusMX •

Post Reply