Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:19
Menu not working when part of a PHP include file
Poster: ccuscMilonic
Dated: Tuesday June 3 2008 - 13:51:01 BST
My problem is that the menu only works when hardcoded onto an html page, but when the code is included dynamically via php for a site that has multiple sections, the menu does not display at all. As long as the http path is the same as the directory path it works, but when included in a page that has a different directory structure, it doesn't work.
For instance, the page that has the code for the menu is "menu.php". It contains the source as follows:
<div><table cellpadding=0 cellspacing=0 style="width:950px;"><tr><td><div style="font-size:1px;width:6px;height:34px;"></div></td><td style="width:100%;">
<script type="text/javascript" src="milonic_src.js"></script>
<script type="text/javascript" src="mmenudom.js"></script>
<script type="text/javascript" src="menu_data.js"></script></td></tr></table>
</DIV></div></div>
It is included in other pages with the following include statement: <?php
{
include('menu.php');
}
?>
Therefore, menu.php does not have the html tags because it is a php include. When the the code is hard coded in the same page/same directory, it works fine. But when the code is produced dynamically resulting in a different URL, it doesn't work. Is there something that must be modified for a dynamic path?
Re: Menu not working when part of a PHP include file
Poster: ccuscMilonic
Dated: Tuesday June 3 2008 - 14:27:23 BST
Actually, I'm using the image menu. Thank you.
Re: Menu not working when part of a PHP include file
Poster: Ruth
Dated: Tuesday June 3 2008 - 17:53:30 BST
Hi,
I think we will need the url to see what's going on, can you provide one please?
Ruth
Re: Menu not working when part of a PHP include file
Poster: ccuscMilonic
Dated: Saturday June 7 2008 - 20:17:45 BST
Hello Ruth,
Actually, I do not have this in production, because I can not get it to work. I am working on it in my local development environment. I am trying to include it as part of a CMS application. I have embedded the menu per instructions by separating the source code of the main menu from the source code of the sub menus and it still doesn't work. I have placed the source code the same directory as the menu to prevent any conflicts with paths. The menu only works when hard coded into a single html page, not when the same code is placed within the CMS. Have you encountered anyone having this problem when used in a CMS? I am concerned as I have already paid for a professional licensed version of this product.
Thank you.
Re: Menu not working when part of a PHP include file
Poster: Ruth
Dated: Saturday June 7 2008 - 23:49:39 BST
Hi,
You will need to contact Milonic through the support system for this. There should be no problem, I know that others have used it with CMS I just don't know how to advise you on the fix or what the issue might be since I 'know nothing' as Schultz would say about CMS. Since you have a paid license you can use the system. Milonic is probably the best I've ever seen out here for supporting their clients and they have a great menu, it's why I starting volunteering on their forum.
http://www.milonic.com/support/
Ruth
Re: Menu not working when part of a PHP include file
Poster: Andy
Dated: Tuesday June 10 2008 - 11:12:35 BST
Hi,
Try accessing the include file directly (if you can) like this: http://www.milonic.com/mainmenu.php - At least this way you should be able to see the output.
Also, make sure that you have PHP logging turned on and can check the error output. Again, this will help pinpoint the problem.
HTH,
Andy