Welcome to Geeklog, Anonymous Thursday, April 18 2024 @ 06:26 pm EDT

Geeklog Forums

Add a navbar to the footer


Status: offline

asmaloney

Forum User
Full Member
Registered: 02/08/04
Posts: 214
I'm working on a site where I wanted the navbar to show up in the header and the footer. As far as I could tell there was no nice way to do this, so... HACK!

In lib-common.php, add this code to the bottom of the function COM_renderMenu():

Text Formatted Code

// ASM hack
    global $ASM_saved_menu;
    $ASM_saved_menu = $header->get( 'menu_elements' );
// ASM hack

 


Then in the function COM_siteFooter(), just before

Text Formatted Code

$exectime = $_PAGE_TIMER->stopTimer();
$exectext = $LANG01[91] . ' ' . $exectime . ' ' . $LANG01[92];

 


add this:

Text Formatted Code

// ASM hack
    global $ASM_saved_menu;
    $footer->set_var( 'menu_elements', $ASM_saved_menu );
// ASM hack

 


That's it - simple and efficient.

I would love to see a solution for this integrated into GL at some point with a config option for placement of the navbars...

Oh, and don't forget to add the {menu_elements} to your theme's footer.thtml...

- Andy
 Quote

Status: offline

chiloso

Forum User
Junior
Registered: 04/18/05
Posts: 24
i would like to see what it looks like. do you have a sample?


Quote by asmaloney: I'm working on a site where I wanted the navbar to show up in the header and the footer. As far as I could tell there was no nice way to do this, so... HACK!

In lib-common.php, add this code to the bottom of the function COM_renderMenu():

Text Formatted Code

// ASM hack
    global $ASM_saved_menu;
    $ASM_saved_menu = $header->get( 'menu_elements' );
// ASM hack


 


Then in the function COM_siteFooter(), just before

Text Formatted Code

$exectime = $_PAGE_TIMER->stopTimer();
$exectext = $LANG01[91] . ' ' . $exectime . ' ' . $LANG01[92];


 


add this:

Text Formatted Code

// ASM hack
    global $ASM_saved_menu;
    $footer->set_var( 'menu_elements', $ASM_saved_menu );
// ASM hack


 


That's it - simple and efficient.

I would love to see a solution for this integrated into GL at some point with a config option for placement of the navbars...

Oh, and don't forget to add the {menu_elements} to your theme's footer.thtml...

- Andy
 Quote

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
I tried it and got a fatel error

Fatal error: Call to a member function on a non-object in g:test.site.netlib-common.php on line 714
 Quote

Status: offline

asmaloney

Forum User
Full Member
Registered: 02/08/04
Posts: 214
@chiloso:

I just did it to my site: IMoL

@ronack:

?? OK. What's on line 714?

- Andy
 Quote

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
Okay I put it in the wrong location. I see your menu but not mine. I'll mess around a bit and try to find out what's going on.
 Quote

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
Okay I got it. It works, for others don't forget to put {menu_elements} in your footer template.
 Quote

All times are EDT. The time is now 06:26 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content