Yesterday I Tweeted that I will be adding Foundation’s Magellan Menu to WP-Forge.
This was initially intended for my new theme WP-Edify but I was asked by a user if it was possible to use Magellan in WP-Forge. I got to thinking about it and decided that it would make a great addition to Forge. I mean, you can basically add anything Foundation related with to Forge, so why not the Magellan menu?
What to do?
I already have the menu working, with the nav walker and all the necessary markup and it works really well if I do say so myself 😉 . However I have run into a bit of a quandary: Now that I have it working, how exactly do I implement it in the theme itself?
So far it seems there is only one possibility and that’s to use it within the front page template. The way I understand it, in order for the magellan menu to work properly, the content needs to have
sections. The links in the menu target these sections and when one is clicked, the page scrolls to that specific section.
In my tests, if the menu is on a page where there are no sections a jQuery error is displayed in Chrome Dev Tools:
Uncaught TypeError: Cannot read property 'top' of undefined at Sticky._parsePoints (foundation.js?ver=188.8.131.52:8356) at foundation.js?ver=184.108.40.206:8320 at e (jquery.js?ver=1.12.4:3) at dispatch (jquery.js?ver=1.12.4:3) at r.handle (jquery.js?ver=1.12.4:3)
Back To Top arrow does not appear when you scroll down. Now when the menu is on a page that has added sections in the content, everything works as it should. As you all know, I try my best to keep WP-Forge free of any type of notices and errors. So this tells me that the menu is going to need either a specific header or a specific page template, maybe even both.
So rather than just adding it the way I would want it, I thought I would open up the discussion and see what the users of WP-Forge would have to say. Seriously, I’d like to know.
How you would do it? What would you like to see? I would like to hear anything and everything you guys have in mind, even if it’s off the wall.