ThemeShaper Forums » Thematic

[closed]

submenu above sidebar

(9 posts)
  • Started 11 years ago by pipsologie
  • Latest reply from pipsologie
  • This topic is not resolved
  1. There are many question about menus, and I went through a lot of them in this forum, but I could not find any solution to my problem:
    I want my submenu not to appear as a dropdown, but above the sidebar as illustrated here: http://www.flickr.com/photos/28112913@N03/6964683470/in/photostream

    Any suggestion how to handle this?

    Posted 11 years ago #
  2. sowingseeds
    Member

    Why not make a custom menu and include it in the sidebar with the Custom menu widget? You can include it as the first item. Simplest... Otherwise:

    1) register a new menu as per the mega menu thread.
    2) add it to the abovemainaside hook.
    3) style as you wish

    So in your functions file:

    register_nav_menus(
    
    array(
    		'primary-menu' => __( 'Primary Menu' ),
    		'sidebar-menu' => __( 'Sidebar Menu' ),
    
    		)
    	);
    
    function menu_abovesidebar(){
    echo '<div class="main-aside">';
    wp_nav_menu( array( 'theme_location' => 'sidebar-menu' ) );
    echo '</div>';
    }
    add_action('thematic_abovemainasides','menu_abovesidebar');
    Posted 11 years ago #
  3. Thank you sowingseeds. the problem is half solved. I wish to see different sidebar-menus at different sites (as shown in the picture above.
    If I client on main menu item 1 I want to see a different submenu at the side than when I click on main menu item 2. Each main menu item has different submenus.

    Someone has an idea to do that?

    Posted 11 years ago #
  4. Here is maybe a better illustration of what I would like to do: http://www.flickr.com/photos/28112913@N03/7113572569/in/photostream

    Posted 11 years ago #
  5. whoa - i'm not sure i'd want to try doing that. that looks very, very complicated, imo. if those sub menus are merely child pages of the current page, that i know you can do w/o too much difficultly, but siphoning off parts of the custom menu? no idea how to do that. you could also use something like widget context to put different menu widgets on different pages.

    Posted 11 years ago #
  6. Just use a text widget and throw some html/links in there :P

    Posted 11 years ago #
  7. @Helga - those sub menus are merely child pages of the current page. How can I create those without difficulty?
    Your second approach would also work, but how can I use different widgets on different pages?
    Also I would like to appear the main menu still as "current" when clicking through the sub menus on the side. Main menu "school" is "current" and submenu item "lesson 1" is "current" as well (as it would be in a submenu)...

    @Jagst3r15 - your approach would still need text widgets that appear in some pages and in other not...

    Posted 11 years ago #
  8. look in the codex.
    http://codex.wordpress.org/Template_Tags/wp_list_pages#List_Sub-Pages

    to add that to thematic you'd add the code to the desired hook... in your case probably thematic_abovemainasides

    function kia_subpages(){
      global $post;
    
      $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
      if ($children) { ?>
      <ul>
      <?php echo $children; ?>
      </ul>
      <?php } ?>
    
    }
    
    add_action('thematic_abovemainasides','kia_subpages');

    totally untested, but in theory should work

    different widgets on different pages can be achieved with either the Widget Logic or Widget Context plugins.

    Posted 11 years ago #
  9. @Helga- thanks a lot for your input. I am testing both approaches and let you know which outcome fits better my needs...

    Posted 11 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.