Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By atanu.dey on
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
hi frnd...., You have to
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....,
Thanks for your reply... To
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 -
is coming in home page but not the contents in side of that ul
hi frnd..., Now print some
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
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...,
..
Hi
You can test your custom menu through block list page, assign it any region and see the output.
Thanks
Dev
Thanks to all
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
New problem occured
Hi,
I'm using the following code and can see menu in all pages in english
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.
Figured out
Figured out :P