Best Answer Evan Mattson , 26 October 2012 - 03:34 AM
Hey there biosopher,
Nice to see someone who isn't afraid to get their feet wet with the core code! I hope you're not editing core files though ![]()
It seems like you're trying to stick the navbar into your branding section, correct? It really isn't necessary to mess with the template map like that.
Actually, if you look in the section.php for the navbar itself, there is an example of how you can insert a section on any hook. That's how the fixed navbar works. Check out the block starting on line 164 of the navbar's section.php:
if(ploption('navbar_fixed')){
build_passive_section(array('sid' => $this->class_name));
add_action( 'pagelines_before_page', create_function( '', 'echo pl_source_comment("Fixed NavBar Section");' ) );
add_action('pagelines_before_page', array(&$this,'passive_section_template'), 10, 2);
pagelines_add_bodyclass('navbar_fixed');
}
This code could be duplicated and modified to run on another hook (like inside the branding section). This code must run from within the navbar section's class though, so to customize it, just copy the navbar section's folder from core into your child theme's sections folder. Just change the action's hook to where you want your passive navbar to go ('pagelines_before_page' to 'your_hook'). Change the added bodyclass to something else if you need it, otherwise you could leave that out.
Good luck! Go to the full post
#1
Posted 24 October 2012 - 11:38 PM
As you can see, I've floated my PLNavBar to the right of my logo. However I now have two PLNavBars appearing, and I've spent multiple hours trying to determine where this 2nd PLNavBar is coming from.
In the_template_map() of class.template.php, I've separated the 'pagelines_header' hook as below so that I control when the PLNavBar is created and placed:
And using Pagelines Customize Plugin, I added this function to add the PLNavBar myself:
The above code works because I updated Branding's section.php with an additional hook within brandings <div>:
So all should be well, but that 2nd PLNavBar is showing up...which it shouldn't as I'm only calling PLNavBar once via add_header_nav(). My ONLY clue thus far is that the 2nd PLNavBar can be removed on a Page-by-Page basis using the WP admin. So it seems the WP admin knows about this 2nd PLNavBar. Is it creating it somehow?
Any suggestions?
#2
Posted 25 October 2012 - 07:44 AM
Unfortunately, we are unable to provide support for custom code you have created. If you need assistance with this type of customisation, I recommend you contact one of our pros -
However, why don't you simply use the BrandNav section, which contains your logo aligned to the left and your navigation aligned to the right.
#3
Posted 25 October 2012 - 04:06 PM
This is what I get 'out of the box' with aligning right. The Nav bar displays the the right BUT below the logo and looks awkward.
{IMAGE GOES HERE]
Hmmm....this forum's fairly antiquated. I can't find a way to upload an image of my site to share. Very disappointing!
#4
Posted 25 October 2012 - 06:10 PM
#5
Posted 26 October 2012 - 12:05 AM
#6
Posted 26 October 2012 - 03:34 AM Best Answer
Nice to see someone who isn't afraid to get their feet wet with the core code! I hope you're not editing core files though
It seems like you're trying to stick the navbar into your branding section, correct? It really isn't necessary to mess with the template map like that.
Actually, if you look in the section.php for the navbar itself, there is an example of how you can insert a section on any hook. That's how the fixed navbar works. Check out the block starting on line 164 of the navbar's section.php:
This code could be duplicated and modified to run on another hook (like inside the branding section). This code must run from within the navbar section's class though, so to customize it, just copy the navbar section's folder from core into your child theme's sections folder. Just change the action's hook to where you want your passive navbar to go ('pagelines_before_page' to 'your_hook'). Change the added bodyclass to something else if you need it, otherwise you could leave that out.
Good luck!
#7
Posted 30 October 2012 - 04:48 PM
#8
Posted 18 March 2013 - 06:45 PM
This is exactly what I would like to do Evan. Is there anyway you could explain the steps a little more detailed Im kinda a noobie
#9
Posted 18 March 2013 - 11:57 PM
Mike,
This is an old topic and outdated due to the updates in Framework in the past 6 months. Please write a new topic.
Thanks for your understanding.


This topic is locked









