1
lloydkirk
Custom links in the main menu
  • 2005/5/7 17:23

  • lloydkirk

  • Just popping in

  • Posts: 20

  • Since: 2005/4/12


How do you add custom links or pages to the main menu?

2
jdseymour
Re: Custom links in the main menu

Hi lloydkirk,

See this Faq Page.

3
lloydkirk
Re: Custom links in the main menu
  • 2005/5/7 20:53

  • lloydkirk

  • Just popping in

  • Posts: 20

  • Since: 2005/4/12


Thanks for the info. For some reason it didn't work though...Here's the code I used.

<table cellspacing="0">
<tr>
<td id="mainmenu">
<a class="menuTop" href="<{$xoops_url}>/"><{$block.lang_home}></a>
<!-- start module menu loop -->
<{foreach item=module from=$block.modules}>
<a class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/"><{$module.name}></a> <{foreach item=sublink from=$module.sublinks}>
<a class="menuSub" href="<{$sublink.url}>"><{$sublink.name}></a>
<{/foreach}>
<{/foreach}>
<!-- end module menu loop -->
<a class="menuMain" href="<{http://z80revelation.darwin-mach.net/forum/}>/">forum</a>
</td> </tr>
</table>

4
jdseymour
Re: Custom links in the main menu

Not sure but try to remove the / from this part:

Quote:
>/">forum</a>
I think it is breaking the URL.

5
lloydkirk
Re: Custom links in the main menu
  • 2005/5/7 23:33

  • lloydkirk

  • Just popping in

  • Posts: 20

  • Since: 2005/4/12


I tried that and it didn't work...?

6
m0nty
Re: Custom links in the main menu
  • 2005/5/7 23:37

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


Quote:

<a class="menuMain" href="<{http://z80revelation.darwin-mach.net/forum/}>/">forum</a>


don't surround a link with smarty tags if it's not an actual smarty value..

use a notmal html format..

<class="menuMain" href="http://z80revelation.darwin-mach.net/forum/">forum</a>

7
lloydkirk
Re: Custom links in the main menu
  • 2005/5/8 18:02

  • lloydkirk

  • Just popping in

  • Posts: 20

  • Since: 2005/4/12


Thanks for the help Monty,but its still not working. I've tried just about everything.

<{$block.lang_home}> <{foreach item=module from=$block.modules}> <{$module.name}> <{foreach item=sublink from=$module.sublinks}> <{$sublink.name}> <{/foreach}> <{/foreach}>


This is the code I have in my system_block_mainmenu.html file now and it works fine. But I would like to add a "forum" link to the main menu that when clicked on will go to http://tifreaks.8.forumer.com/. Could someone please help me?

8
rowdie
Re: Custom links in the main menu
  • 2005/5/8 18:11

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


Monty's code should work. What exactly do you mean by "not working"? Is the problem that is doesn't show up in your main menu, or that it links to the wrong url?

Going back to your original post, it should look like this;
<table cellspacing="0">
<
tr>
<
td id="mainmenu">
<
class="menuTop" href="<{$xoops_url}>/"><{$block.lang_home}></a>
<!-- 
start module menu loop -->
<{foreach 
item=module from=$block.modules}>
<
class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/"><{$module.name}></a> <{foreach item=sublink from=$module.sublinks}>
<
class="menuSub" href="<{$sublink.url}>"><{$sublink.name}></a>
<{/foreach}>
<{/foreach}>
<!-- 
end module menu loop -->
<
class="menuMain" href="http://z80revelation.darwin-mach.net/forum/">forum</a>
</
td> </tr>
</
table>


Is that what you tried?

9
lloydkirk
Re: Custom links in the main menu
  • 2005/5/8 22:58

  • lloydkirk

  • Just popping in

  • Posts: 20

  • Since: 2005/4/12


I tried that and it doesn't show. In fact, when I use this code the all the links under the main menu dissapear, and the code is displayed instead. Am i suppose to add this code in addition to whats already in that file.

10
rowdie
Re: Custom links in the main menu
  • 2005/5/8 23:12

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


No, it has to replace what is in that template file, not be added to it.

I just tried it and it works on my test site, which has XOOPS 2.0.10 installed. I saw that the link was wrong though, it should behttp://tifreaks.8.forumer.com/ like you posted a few posts above.

Are you using the default templates, or did you clone them through system admin->templates? you may need to update the system module if you are using the default template, or upload the changed template through system admin->templates if you are using a cloned/custom template set.

Login

Who's Online

159 user(s) are online (98 user(s) are browsing Support Forums)


Members: 0


Guests: 159


more...

Donat-O-Meter

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

Latest GitHub Commits