adding external link
#1
Just popping in
Just popping in


See User information
how can i add external link on main menu navigation?

Posted on: 2003/4/11 7:48
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: adding external link
#2
Just popping in
Just popping in


See User information
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:

// === 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);
?>

// === 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?

Posted on: 2003/4/11 8:10
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: adding external link
#3
Just popping in
Just popping in


See User information
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.

Posted on: 2003/4/11 18:16
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: adding external link
#4
Just popping in
Just popping in


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

Posted on: 2004/6/14 10:36
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You can vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Login
Username:

Password:

Remember me



Lost Password?

Register now!
Search
Recent Posts
Who's Online
138 user(s) are online (104 user(s) are browsing Support Forums)

Members: 0
Guests: 138

more...
Donat-O-Meter
Make donations with PayPal!
Stats
Goal: AU$15.00
Due Date: Jul 31
Gross Amount: AU$0.00
Net Balance: AU$0.00
Left to go: AU$15.00
Latest GitHub Commits
Recent forum posts
Recent Comments
About us
Learn
Use
Develop GitHub
Contribute
Connect
Terms of Use | Privacy Policy | Hosted by Arvixe Hosting | RSS 2.0 Button