1
densma
adding external link
  • 2003/4/11 7:48

  • densma

  • Just popping in

  • Posts: 23

  • Since: 2002/8/2 1


how can i add external link on main menu navigation?

2
mbogosian
Re: adding external link
  • 2003/4/11 8:10

  • mbogosian

  • Just popping in

  • Posts: 53

  • Since: 2002/9/30


Quote:
densma wrote:
how can i add external link on main menu navigation?

AFAIK, you can write a very simple module to do this, but it's kind of (read as "very much") a hack. Here's an example which creates a like to The EFF (where you should immediately go and donate if you haven't done so recently). This example also creates a sub menu with a "donate" link (however, you should be careful with sub menus, because some themes won't display them unless you're actually in that module, which will never happen here). Create the following files:

<?php
// === html/modules/my_main_menu_hack/index.php ===
include 'mainfile.php';
// This is just to get past the automatic URL recognition
// when I posted it to this forum
$url 'http' '://' 'eff.org/';
// Redirect the browser to the desired location
header('Location: ' $url);
?>

<?php
// === html/modules/my_main_menu_hack/xoops_version.php ===
// This will be the name of the link
$modversion['name'] = 'Visit The EFF';
// This must be the same as the directory name in which this
// module resides
$modversion['dirname'] = 'my_main_menu_hack';
// No admin menu
$modversion['hasAdmin'] = 0;
// We do have a main menu
$modversion['hasMain'] = 1;
// The following three lines make up the sub menu, so you
// may want to omit them
$modversion['sub'][1]['name'] = 'Donate';
$url 'http' '://' 'eff.org/donate/';
$modversion['sub'][1]['url'] = $url;
?>

I think that should work. It's a total hack though. Are there any other easier ways that anyone else out there knows of?

3
mbogosian
Re: adding external link
  • 2003/4/11 18:16

  • mbogosian

  • Just popping in

  • Posts: 53

  • Since: 2002/9/30


For an alternative, check out this thread. It suggests building the links right into the theme. This may be less flexible, but it will be a lot easier for you.

4
Acithata
Re: adding external link
  • 2004/6/14 10:36

  • Acithata

  • Just popping in

  • Posts: 45

  • Since: 2004/3/30


No idea how to get this to work. I create everything as said but it just says it cant find the module file.

Login

Who's Online

180 user(s) are online (124 user(s) are browsing Support Forums)


Members: 0


Guests: 180


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits