WordPress.org

Forums

Mega Menu Settings (4 posts)

  1. revxx14
    Member
    Posted 10 months ago #

    WordPress needs native mega menu features. I imagine a setting in a theme's functions like so:

    add_theme_support("mega-menu");

    This would do a few things.

    1. Wrap first level drop downs in <div>, or <section> if add_theme_support("html5") is configured, or possibly even <menu>, although I'm not sure that valid usage of <menu>.
    2. Insert a new section in the menu editor titled "Menu Structure." this would include two new elements:
      1. Start New Column - This would simply start a new unordered list where it was positioned in the menu. Ideally, you would only be able to place it in the first level drop down.
      2. Widget - This would allow the user to pick a widget to appear in the specified location. Again, this should only work in the first level drop down.
    3. Add new classes to top level <li> such as mega-menu and four-columns depending on the number of breaks and widgets within the menu.

    The output HTML from all of this would appear as the following:

    <ul>
    	<li><a href="#">Link</a></li>
    	<li><a href="#">Link</a></li>
    	<li class="mega-menu columns-3">
    		<a href="#">Link</a>
    		<section>
    			<ul>
    				<li><a href="#">Link</a></li>
    				<li><a href="#">Link</a></li>
    				<li><a href="#">Link</a></li>
    			<!-- break element start -->
    			</ul>
    			<ul>
    			<!-- break element end -->
    				<li><a href="#">Link</a></li>
    				<li><a href="#">Link</a></li>
    				<li><a href="#">Link</a></li>
    			</ul>
    			<!-- widget element start -->
    			<aside>
    				<h1>Widget</h1>
    				<p>Widget</p>
    			</aside>
    			<!-- widget element end -->
    		</section>
    	</li>
    	<li><a href="#">Link</a></li>
    	<li>
    		<a href="#">Link</a>
    		<section>
    			<ul>
    				<li><a href="#">Link</a></li>
    				<li><a href="#">Link</a></li>
    				<li><a href="#">Link</a></li>
    				<li><a href="#">Link</a></li>
    			</ul>
    		</section>
    	</li>
    	<li><a href="#">Link</a></li>
    	<li><a href="#">Link</a></li>
    	<li><a href="#">Link</a></li>
    </ul>

    This would allow a simple structure for developers to tie in to, without having to find some overpowered plugin.

  2. esmi
    Forum Moderator
    Posted 10 months ago #

  3. revxx14
    Member
    Posted 10 months ago #

    Yes, essentially. I decided if I posted as a plugin request someone might get it done faster than waiting for it to come to the core WordPress stuff.

  4. Andrew
    Forum moderator
    Posted 10 months ago #

    What was the reason why you wanted it in core, again?

Reply

You must log in to post.

About this Topic