YesKofod95 wrote: ↑Fri Dec 31, 2021 12:00 pmIt is better that it shows nothing than it shows something wrong. As far as I remember, the modules are called from table.configuration, with a key that is similar to MODULES_NAVBAR_INSTALLED - Do you have a new one like this for your new navbar_header-modules?
//Daniel
Making another Navbar for Header
- tessthepup
- Certified Developer
- Posts: 382
- Joined: Mon Mar 01, 2021 5:55 pm
- Phoenix Version:
- Has thanked: 47 times
- Been thanked: 62 times
Re: Making another Navbar for Header
You do not have the required permissions to view the files attached to this post.
- tessthepup
- Certified Developer
- Posts: 382
- Joined: Mon Mar 01, 2021 5:55 pm
- Phoenix Version:
- Has thanked: 47 times
- Been thanked: 62 times
Re: Making another Navbar for Header
ok I managed to solve the problem with navbar items duplicating in the new navbar
Whether this way is the correct way I am not sure, maybe one of the experts could confirm yes or no?
I copied an renamed includes/system/versioned/1.0.5.1/abstract_block_module.php to abstract_block_module_navbar.php
and changed the contents as follows:
The only issue I have now is the the hamburger menu controls both navbars. I tried to change the id but not sure if/where else to change 
Whether this way is the correct way I am not sure, maybe one of the experts could confirm yes or no?
I copied an renamed includes/system/versioned/1.0.5.1/abstract_block_module.php to abstract_block_module_navbar.php
and changed the contents as follows:
Code: Select all
abstract class abstract_block_module_navbar extends abstract_module {
protected $group;
protected $mr_auto;
function __construct() {
parent::__construct();
if ( defined(static::CONFIG_KEY_BASE . 'STATUS') ) {
switch (constant(static::CONFIG_KEY_BASE . 'CONTENT_PLACEMENT')) {
case 'Home':
$this->group = 'navbar_header_modules_home';
break;
case 'Left':
$this->group = 'navbar_header_modules_left';
break;
case 'Center':
$this->group = 'navbar_header_modules_center';
break;
case 'Right':
$this->group = 'navbar_header_modules_right';
break;
}
}
}
public function get_group() {
return $this->group;
}
}
- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Re: Making another Navbar for Header
Well done! Sorry for not getting back to you, I had the topic bookmarked for when I had a little more time to look at it. Never got to do that, as you solved it yourself!tessthepup wrote: ↑Sat Jan 01, 2022 4:27 pm ok I managed to solve the problem with navbar items duplicating in the new navbar
I *think* you have done it "the right way" - it works and you accomplished what you needed with files completely in your control. Maybe the abstract_block_module could be done in a "righter way", but I'm not sure.
If I remember it right, there is the id in the Hamburger-menu-module and in the template-file for the navigation-module. I guess you have those two already?tessthepup wrote: ↑Sat Jan 01, 2022 4:27 pm The only issue I have now is the the hamburger menu controls both navbars. I tried to change the id but not sure if/where else to change![]()
//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide
- tessthepup
- Certified Developer
- Posts: 382
- Joined: Mon Mar 01, 2021 5:55 pm
- Phoenix Version:
- Has thanked: 47 times
- Been thanked: 62 times
Re: Making another Navbar for Header
Thanks Daniel, time to copy the hamburger-menu-module although I wonder if there is a better way as having 2 hamburger menu's seems a bit daftKofod95 wrote: ↑Sat Jan 01, 2022 5:24 pmWell done! Sorry for not getting back to you, I had the topic bookmarked for when I had a little more time to look at it. Never got to do that, as you solved it yourself!tessthepup wrote: ↑Sat Jan 01, 2022 4:27 pm ok I managed to solve the problem with navbar items duplicating in the new navbar
I *think* you have done it "the right way" - it works and you accomplished what you needed with files completely in your control. Maybe the abstract_block_module could be done in a "righter way", but I'm not sure.
If I remember it right, there is the id in the Hamburger-menu-module and in the template-file for the navigation-module. I guess you have those two already?tessthepup wrote: ↑Sat Jan 01, 2022 4:27 pm The only issue I have now is the the hamburger menu controls both navbars. I tried to change the id but not sure if/where else to change![]()
//Daniel
- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Re: Making another Navbar for Header
If you prefer your new navbar not to collapse, that could be done simply by removing this line from your new Header-modules' template file:tessthepup wrote: ↑Sat Jan 01, 2022 5:49 pm I wonder if there is a better way as having 2 hamburger menu's seems a bit daft
Code: Select all
<div class="collapse navbar-collapse" id="collapseCoreNav">
You could also just set the 'Collapse'-setting to 'navbar-expand' on which ever of the two you don't want to collapse. Be aware of the look on small screens though!
//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide
- tessthepup
- Certified Developer
- Posts: 382
- Joined: Mon Mar 01, 2021 5:55 pm
- Phoenix Version:
- Has thanked: 47 times
- Been thanked: 62 times
Re: Making another Navbar for Header
I will have to have a ponder on the best way of doing itKofod95 wrote: ↑Sat Jan 01, 2022 5:56 pmIf you prefer your new navbar not to collapse, that could be done simply by removing this line from your new Header-modules' template file:tessthepup wrote: ↑Sat Jan 01, 2022 5:49 pm I wonder if there is a better way as having 2 hamburger menu's seems a bit daftalong with its' closing </div>.Code: Select all
<div class="collapse navbar-collapse" id="collapseCoreNav">
You could also just set the 'Collapse'-setting to 'navbar-expand' on which ever of the two you don't want to collapse. Be aware of the look on small screens though!
//Daniel
- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Re: Making another Navbar for Header
Enjoytessthepup wrote: ↑Sat Jan 01, 2022 6:04 pm I will have to have a ponder on the best way of doing it
I just remembered something that might have saved you all the work:
The Menu Master addon which even has a lite version. Sorry for having forgot about that!
//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide
- tessthepup
- Certified Developer
- Posts: 382
- Joined: Mon Mar 01, 2021 5:55 pm
- Phoenix Version:
- Has thanked: 47 times
- Been thanked: 62 times
Re: Making another Navbar for Header
I did initially look at that but you dont learn if you dont doKofod95 wrote: ↑Sat Jan 01, 2022 6:16 pmEnjoytessthepup wrote: ↑Sat Jan 01, 2022 6:04 pm I will have to have a ponder on the best way of doing it
I just remembered something that might have saved you all the work:
The Menu Master addon which even has a lite version. Sorry for having forgot about that!
//Daniel