1
Wonderfish1
Adding items to main menu

I have read all of the posts about this and cannot see what I have done wrong....

Ghia advised:

In /modules/system/templates/system_block_mainmenu.html add links like eg
My Page
between
<{/foreach}>
<{/foreach}>
and



My system_block_mainmenu.html now looks like this:

<div id="mainmenu">     <class="menuTop <{if !$block.nothome}>maincurrent<{/if}>" href="<{xoAppUrl }>" title="<{$block.lang_home}>"><{$block.lang_home}>a>       <{foreach item=module from=$block.modules}>         <class="menuMain <{if $module.highlight}>maincurrent<{/if}>" href="<{$xoops_url}>/modules/<{$module.directory}>/" title="<{$module.name}>"><{$module.name}>a>         <{foreach item=sublink from=$module.sublinks}>             <class="menuSub" href="<{$sublink.url}>" title="<{$sublink.name}>"><{$sublink.name}>a>         <{/foreach}>     <{/foreach}>                  <class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=6">T8 lightinga>             <class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=7">T5 lightinga>             <class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=8">Power Compacta>             <class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=10">Moonlightsa>             <class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=5">Reptile lightinga>             <class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=11">Hi-outputa>             <class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=3">Plasma lightinga>           div>


Shouldn't that work?

TIA,
Tim

2
Wonderfish1
Re: Adding items to main menu

Hi all,

I have been researching this very hard because I really need a solution soon and have found some weird things.

According to the FAQ system_blocks_mainmenu.html is supposed to look like this:

<table cellspacing="0">
  <
tr>
    <
td id="mainmenu">
      <
class="menuTop" href="<{$xoops_url}>/"><{$block.lang_home}>a>
      
      <{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}>
      
    td>
  tr>
table>



Mine looks like this:

<div id="mainmenu">
    <
class="menuTop <{if !$block.nothome}>maincurrent<{/if}>" href="<{xoAppUrl }>" title="<{$block.lang_home}>"><{$block.lang_home}>a>
 
    <{foreach 
item=module from=$block.modules}>
        <
class="menuMain <{if $module.highlight}>maincurrent<{/if}>" href="<{$xoops_url}>/modules/<{$module.directory}>/" title="<{$module.name}>"><{$module.name}>a>
        <{foreach 
item=sublink from=$module.sublinks}>
            <
class="menuSub" href="<{$sublink.url}>" title="<{$sublink.name}>"><{$sublink.name}>a>
        <{/foreach}>
    <{/foreach}>
    
div>


Both seem to work, but I can't add links to either of them. I have been updating the system module, clearing the cache etc but I can't make this work.

Anybody have any ideas?


Thanks,
Tim

3
ghia
Re: Adding items to main menu
  • 2011/1/4 9:04

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


The code of your first post should work.
Did you update the system module or set check templates for changes to on in the preferences?

4
Wonderfish1
Re: Adding items to main menu

Hi ghia and thanks again for your help.

I redid everything to ensure it was correct - the code in system_block_mainmenu.html looks as follows:

<table cellspacing="0">
  <
tr>
    <
td id="mainmenu">
      <
class="menuTop" href="<{$xoops_url}>/"><{$block.lang_home}>a>
       
      <{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}>
      
         <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=6">T8 lightinga>
         <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=7">T5 lightinga>
         <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=8">Power Compacta>
         <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=10">Moonlightsa>
         <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=5">Reptile lightinga>
         <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=11">Hi-outputa>
         <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=3">Plasma lightinga>               
      
      
      
    td>
  tr>
table>


I have set update templates to on
I have updated the system module
I have flushed all of the caches

I still just get the standard menu

Thanks
Tim

5
redheadedrod
Re: Adding items to main menu

Are you using firefox? I have found firebug to be a great help when debugging issues like this.

Your code appears as if it SHOULD work. There is nothing fancy that you are missing.

The difference between the two entries you show is that the "old school" way is to use tables to create layouts. That has changed and in "todays" world with CSS and XHTML they have gone to using DIV's. Either should work and since you are using a different template than the original one you could "show source" and see if the main menu is surrounded with a div or a table. If it is surrounded with a DIV then you missed something as it is using the original template. If it is using a table then it is using your code but for some reason not picking up your entries.

For debugging purposes while you are testing this out you could also insert a line such as...

Test Entry



Or even


to see if it is an issue with your links or something.
Since it is not a link you will likely get the same response with either line above but you SHOULD get something on the menu.

But then again you SHOULD be getting something on the menu with the code you have. Has to be something with how the template is setup. Double check your settings and make sure all the caches are cleared. Also make sure your file name is EXACTLY the same as the original found on your system. Same case and everything since filenames are case sensitive depending on the OS of the server.

6
Wonderfish1
Re: Adding items to main menu

Hi and thanks Rod,

I am perplexed - it appears to be using a div and I am not sure how that is even possible, given the code it is drawing from.

The menu part looks like this:

<div class="blockContent"> <div id="mainmenu">
    <
class="menuTop maincurrent" href="http://aqualina.com.au/" title="Home">Homea>
    
            <
class="menuMain " href="http://aqualina.com.au/modules/AMS/" title="Applications">Applicationsa>

                    <
class="menuMain " href="http://aqualina.com.au/modules/news/" title="Products">Productsa>
                
div>div>


If i got the right part.

Should I go back to the div based code and try to change that?

7
Wonderfish1
Re: Adding items to main menu

I have gone back to the div style

It now looks like this:

<div id="mainmenu">
    <
class="menuTop <{if !$block.nothome}>maincurrent<{/if}>" href="<{xoAppUrl }>" title="<{$block.lang_home}>"><{$block.lang_home}>a>
 
    <{foreach 
item=module from=$block.modules}>
        <
class="menuMain <{if $module.highlight}>maincurrent<{/if}>" href="<{$xoops_url}>/modules/<{$module.directory}>/" title="<{$module.name}>"><{$module.name}>a>
        <{foreach 
item=sublink from=$module.sublinks}>
            <
class="menuSub" href="<{$sublink.url}>" title="<{$sublink.name}>"><{$sublink.name}>a>
        <{/foreach}>
    <{/foreach}>
    
    <
p>Test Entryp>


<
class="menuMain">Test Entryp>
    
            <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=6">T8 lightinga>
            <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=7">T5 lightinga>
            <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=8">Power Compacta>
            <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=10">Moonlightsa>
            <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=5">Reptile lightinga>
            <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=11">Hi-outputa>
            <
class="menuMain" href="http://aqualina.com.au/modules/news/index.php?storytopic=3">Plasma lightinga>
    
    
div>


It is only giving me the standard menu - it is like it is not even looking at it

8
redheadedrod
Re: Adding items to main menu

Ok a couple more ideas...

What version of Xoops are you using?

Double check that you do have the "Check for modified templates" set you yes.

Also make sure you are using the default template set.

If you have cloned the template set and using them then I believe the system will use the cloned templates in all areas and won't even look at the files on the system. In that case you would have to edit the cloned templates.


Rodney



9
ghia
Re: Adding items to main menu
  • 2011/1/5 9:07

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Also check your theme for overloaded templates in /themes/yourtheme/modules/system/

10
Wonderfish1
Re: Adding items to main menu

Hi and thanks again,

I am using Xoops 2.4.5

Check for modified templates is set to yes

It doesn't work either in default or the modified template. I have left the theme selector up so you can see that if you wish.

There is no /themes/yourtheme/modules/system/ directory - it is all in the root of the theme directory (i.e. /themes/montisblue/)




Login

Who's Online

164 user(s) are online (110 user(s) are browsing Support Forums)


Members: 0


Guests: 164


more...

Donat-O-Meter

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

Latest GitHub Commits