smartfaq
SmartFAQ is developed by The SmartFactory (http://www.smartfactory.ca), a division of InBox Solutions (http://www.inboxsolutions.net)

Display Link to any page in the main menu.
Requested and Answered by Samer on 2005/11/22 19:19:46 (11152 reads)
Modify the system_block_mainmenu.html template under 'System'

As an example, I have used the formulaire module
Use the following code:
Quote:







Here , I have displayed a link to the first form in the formulaire module instead of the link to the formulaire homepage.

Of course, the module must be installed and has a weight different from zero.




The comments are owned by the author. We aren't responsible for their content.
  • Just popping in

 how?

Quote:

Display Link to any page in the main menu.


Let's say that I have a page: mypage.txt
How can I add a link to it in main menu?

Acording to this FAQ I can add a link only if I have a module instaled.
Thank you in advance.

 
  • Not too shy to talk

 Re: how?

I would be interested in how to do this as well.

 
  • Community Support Member

 Re: how?

Hi,

If this is the default template for Main Menu:

<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 -->
    </
td>
  </
tr>
</
table>



Here is how you could add permanent "Lost password" link, that will be visible only for not loged users:

<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 -->
    </
td>
  </
tr>
  <
tr>
    <
td id="lpass">
      <{if !
$xoops_isuser}>
      <
br />
      <
a href="<{$xoops_url}>/user.php#lost"><{$smarty.const._MB_SYSTEM_LPASS}></a>
      <
br />
      <{/if}>
    </
td>
  </
tr>
</
table>


Hope this helps

 
  • Not too shy to talk

 Re: how?

Thanks Stefan! That is just what I needed!

 
  • Just popping in

 Re: how?

How about displaying a link to a certain module for anonymous users. My guestbook link only displays under the main menu after a registered user logs in. I would like the guestbook link to show up under main menu without having to login. Is this the same thing I need to do? Unfortunately the guestbook does not have it's own "blocks" administration.

 
  • Just popping in

 Re: how?

Ok...I followed the instructions...and the Guestbook link now appears to anonymous users. However, anonymous users are not permitted to view this module. Again...this module does not have it's own "permissions" tool to grant anonymous access. Where can I set this?

 
  • Just popping in

 Re: how?

Sorry....I found my answer. I had to go to Control Panel/System | Groups. I granted the anonymous group module access there. Didn't realize this was here. Thanks.