Hello,

I made a custom menu. And I added the following code in page.tpl.php page.

<?php print theme('menu_tree', menu_tree('menu-footer')); ?>

For example when on page,

http://10.0.0.100:81/atanu/nbt/about-us.html - the menu is coming with -

<ul class="menu"><ul class="menu"><li class="leaf first last"><a title="Career opportunities" href="/atanu/nbt/node/84">Career</a></li>
</ul></ul>

but when on page,

http://10.0.0.100:81/atanu/nbt/

<ul class="menu"></ul>

thus no menu is coming... what is the work around?

Comments

hilarudeens’s picture

hi frnd....,
You have to confirm the page http://10.0.0.100:81/atanu/nbt/ is rendering from page.tpl.php...

There is choice different URL rendering from different .tpl.php. Generally home page rendered from page-front.tpl.php and other pages are coming from page.tpl.php....

good luck....,

atanu.dey’s picture

Thanks for your reply...

To test what you've said, I added some random text to the page.tpl.php..

I'm able to see that text through both of the links, but not the menu...

even you can notice -

<ul class="menu"></ul>

is coming in home page but not the contents in side of that ul

hilarudeens’s picture

hi frnd...,
Now print some dummy text in tpl.php file which is related to "menu_tree" and then go to statement
<?php print theme('menu_tree', menu_tree('menu-footer')); ?>
and check menu_tree('menu-footer') function returns the value in the both links what you mentioned.....by changing as follows

<?php 
           print menu_tree('menu-footer');
           print theme('menu_tree', menu_tree('menu-footer'));
?>

or
if you are defined 'menu_tree' in theme_menu_tree() function then add some dummy text within these & track your code....
and then try after changing template's alias name "menu_tree" without conflict by function "menu_tree()"...

good luck friend...,

devtherock’s picture

Hi

You can test your custom menu through block list page, assign it any region and see the output.

Thanks
Dev

atanu.dey’s picture

Hello,

I figured out. This is happening because my site is a mutilingual site. And my home page content was set in "hindi" which is not the default language. It just solved when I switched it to english. I need to add a "hindi" translation of the same menu.

It was a silly mistake, but thanks a lot.

regards

atanu.dey’s picture

Hi,

I'm using the following code and can see menu in all pages in english

<?php print theme('menu_tree', menu_tree('menu-footer')); ?>

But, facing a new problem now... even after translating my menus in "hindi", can't see them.

but same thing is working properly for primary and secondary links. They are showing hindi menus properly...

please note: I add all menus in language neutral mode and translate them through "Translate Interface"

Any help will be highly appreciated.

atanu.dey’s picture

Figured out :P