WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: markywatts on April 15, 2009, 11:29:15 AM

Title: multiple menu setup using show_menu2
Post by: markywatts on April 15, 2009, 11:29:15 AM
Hi,

I would like to have a template that allows:
-  Main menu across top (Pages unique to main menu)
-  Footer menu across bottom (Pages unique to footer)
-  Using show_menu2 addon

So the sites main content is in main menu and the sitemap disclaimer and credits pages are only displayed in the footer menu.  I have got this working with the following code, but when I view one of the pages that is linked uniquely in the footer eg.  sitemap or site credits the main menu links changed to the footer ones!! so you can't navigate the rest of the site!  These pages should be the same.  So when you view any page it shows a main menu across top and a footer menu across bottom. (each menu having pages unique to that menu)

See my code, info.php has:

$menu[2]    ='Footer Menu';
$block[1]   = 'Photo Header';
$block[2]   = 'First Column';
$block[3]   = 'Thumbnails';
$block[4]   = 'Second Column';

index.php has:

<body id="home">
<div class="container_16 clear">

             <div class="grid_16" id="header">
            <img src="<?php echo TEMPLATE_DIR;?>/images/header/logo.gif" alt="Logo" width="300" height="104"/><img src="<?php echo TEMPLATE_DIR;?>/images/header/strapline.gif" alt="" width="630" height="104"/>
            </div>
            <!-- end .grid_16 -->
<div class="clear">&nbsp;</div>

             <div class="grid_16 clearfix" id="nav">
            <?php show_menu2(0, SM2_ROOT, SM2_ALL, SM2_ALL, false, "\n</li>", false, false, false, '<ul id="header_menu" class="menu">'); ?><br /></div><!-- end nav -->
           
<div class="clear">&nbsp;</div>

             <div class="grid_16" id="photoheader">
            <?php page_content(1); ?>
            </div>
            <!-- end .grid_16 -->

             <div class="grid_16" id="content">
                        <div class="grid_8 alpha" id="FirstColumn">
                        <?php page_content(2); ?>
                        <!-- <?php echo page_content(1); ?> -->
                        </div>
                        <div class="grid_8 omega" id="SecondColumn">
                        <div id="thumbnail_brd">
                        <?php page_content(3); ?>
                        </div>
<div class="clear">&nbsp;</div>
                        <?php page_content(4); ?>
                        </div>
            </div>
            <!-- end .grid_16 -->
<div class="clear">&nbsp;</div>

             <div class="grid_16 topmargin20" id="footer">
                        <div class="grid_16 alpha omega" id="footerlinks">
                        <?php page_footer(); ?>
                        <br clear="all">
                       
                        <div id="footer_menu"><p>&copy; 2009 <?php show_menu2(2,0,1); ?></p></div>
                        </div>
            </div>
            <!-- end .grid_16 -->

</div>
<!-- end .container_16 -->

    </body>

What have i done wrong? 

Thanks
Mark
Title: Re: multiple menu setup using show_menu2
Post by: BlackTiger on April 15, 2009, 12:33:33 PM
Hi Mark,

in your info.php should also be an entry for the main menu like:

Code: [Select]
$menu[1] = 'Main Menu';

Next you didn't tell something about the structure of your pages. In this post (https://forum.WebsiteBaker.org/index.php/topic,13209.msg82837.html#msg82837) I described a way to build a working structure.

Your calls to show_menu2 are also not correct. The first call should use a 1 instead of 0 as first parameter - to get the Main Menu and the second call should look like the one I posted in the link above.

I hope this helps
Michael
Title: Re: multiple menu setup using show_menu2
Post by: markywatts on April 15, 2009, 03:44:08 PM
Thank you Michael !  :-)

Al working now,  this site is still work in progress but you can now at least see that the footer links are working apart from styling, with the main menu working when on site map page.  http://www.chateauarnac.co.uk/

Website baker is a superb CMS !

Thanks
Mark