Jump to content
Sign in to follow this  
basmati

Different menus in Navigation BrandNav Section?

Recommended Posts

basmati

Hi there and thanks a lot for the excellent new features in Platform! My question: in the template setup area for the header i just created a "Navigation" and below a "BrandNav Section". Now i would like to choose different menus for the "Navigation" on top and the menu below in the "BrandNav Section" - - is this possible? thanks for your help!

Share this post


Link to post
Share on other sites
cmunns

You can overwrite the brandnav template area and change the theme location there. You may have to create a new theme location but you do the latter by copying this portion ` pagelines_main_logo(); pagelines_register_hook( 'brandnav_after_brand', 'brandnav' ); // Hook ?>

<?php if(function_exists('wp_nav_menu')){ wp_nav_menu( array('menu_class' => 'main-nav'.pagelines_nav_classes(), 'container' => null, 'container_class' => '', 'depth' => 3, 'theme_location'=>'primary', 'fallback_cb'=>'pagelines_nav_fallback') ); }else{ pagelines_nav_fallback(); } pagelines_register_hook( 'brandnav_after_nav', 'brandnav' ); // Hook ?>
<?php } ` and placing it in the root of the PlatformBase in a file called template.brandnav.php

Share this post


Link to post
Share on other sites
basmati

ok, i took the "template.override.php" in the root of PlatformBase, put the code above inside and rename it to "template.brandnav.php". I guess that was your idea? now i still have the main Navigation above and the headerimage, but underneath the headerimage the brandnav and the whole rest of pagecontent is missing. do i have to create a section?

Share this post


Link to post
Share on other sites
cmunns

Well if you copied what was above exactly then you probably have the error because of the PHP tags I accidentally put in at the end `<?php }` What is your site again?

Share this post


Link to post
Share on other sites
basmati

it works with

<div class="inline-nav main_nav fix">
	<?php
					if(function_exists('wp_nav_menu')){
						wp_nav_menu( array('menu_class'  => 'main-nav'.pagelines_nav_classes(), 'container' => null, 'container_class' => '', 'depth' => 3, 'theme_location'=>'primary', 'fallback_cb'=>'pagelines_nav_fallback') );
					}else{ pagelines_nav_fallback(); }
					pagelines_register_hook( 'brandnav_after_nav', 'brandnav' ); // Hook
	?>
	</div>

but i cant choose a menu in wordpress backend. any ideas?

Share this post


Link to post
Share on other sites
cmunns

If it works with that then just change your parameters. 1) remove the theme_location parameter otherwise it will match your primary nav. 2) add the 'menu' => 'Menu Name' parameter to match the one you created in APPEARANCE - MENUS

Share this post


Link to post
Share on other sites
basmati

Adam, thanks a lot - thats it. now i begin to understand the power of sections, very enlightening! For all searching people: Creating a secondary navigation within the brandnav section. 1. in the base folder: open "template.override.php" and put the following code inside - than save and close the file.

<div class="inline-nav main_nav fix">
	<?php
	if(function_exists('wp_nav_menu')){
						wp_nav_menu( array('menu'  => brandnav, 'menu_class'  => 'main-nav'.pagelines_nav_classes(), 'container' => null, 'container_class' => '', 'depth' => 3, 'fallback_cb'=>'pagelines_nav_fallback') );
					}else{ pagelines_nav_fallback(); }
	pagelines_register_hook( 'brandnav_after_nav', 'brandnav' ); // Hook
	?>
	</div>
2. rename "template.override.php" to "template.brandnav.php" 3. create a navigation of your choise in wordpress, matching the menu name in the php above - in this case "brandnav". 4. in platform settings enable "BrandNav Section" 5. style the new Navigationbar for example with css like this:
#brandnav {
		background: url("images/header-home.jpg") no-repeat scroll 0 0 transparent;
		padding: 23px 0px 11px;
		margin-bottom: 0.7em;
		width:960px;
		height:335px;
	}
	#brandnav .main_nav {
		position:absolute;
		width: 100%;
		bottom:2.4em;
	}
	#brandnav .mainlogo-link, #brandnav .title-container{
	    float: left;
	    line-height: 0.7em;
		width: 100%;
		padding: 0 1%;
	}
	#brandnav .mainlogo-link img{
		max-width: 100%;
	}
	#brandnav .main_nav ul.main-nav {
	    background: none repeat scroll 0 0 #961823;
	    padding-left: 1em;
	    margin-left:16px;
	    float:left;
	    width:810px;
	    height:45px;
	}
	#brandnav li a, #brandnav .nav-special {
	    display: block;
	    text-decoration: none;
	}
	#brandnav a.nav-special {
	    display: block;
	    float: right;
		margin-right: 0;
	}
	#brandnav .current_page_item a {
		color:#FFFFFF;
		font-weight:bold;
		text-decoration:none;
		background:none repeat scroll 0 0 transparent;
	}
	#brandnav a {
		color:#FFFFFF;
		text-decoration:none;
		text-transform:none;
		background:none repeat scroll 0 0 transparent;
	}
	#brandnav ul li{
	    background: url("images/whiteline-s.gif") no-repeat scroll 5px 10px transparent;
	}

Share this post


Link to post
Share on other sites
zvelena
Interesting but if I write the code you posted <div class="inline-nav main_nav fix"> <?php if(function_exists('wp_nav_menu')){ wp_nav_menu( array('menu' => brandnav, 'menu_class' => 'main-nav'.pagelines_nav_classes(), 'container' => null, 'container_class' => '', 'depth' => 3, 'fallback_cb'=>'pagelines_nav_fallback') ); }else{ pagelines_nav_fallback(); } pagelines_register_hook( 'brandnav_after_nav', 'brandnav' ); // Hook ?> </div> I get the code spread all around the header. I made all previous steps, renamed to template.brandnav.php but it's not working. Thanks for your remarks.

Share this post


Link to post
Share on other sites
Rob
@zvelena - This is an older posting and there have been upgrades since. I'd suggest opening a new question on this and including your URL and what version of Platform you have and which is activated.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
zvelena
Thanks range, will do so. Indeed I have a recent version of PlatformPro.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×