Menu not working when part of a PHP include file

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
ccuscMilonic
Beginner
Beginner
Posts: 3
Joined: Tue Jun 03, 2008 1:40 pm

Menu not working when part of a PHP include file

Post by ccuscMilonic »

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?
ccuscMilonic
Beginner
Beginner
Posts: 3
Joined: Tue Jun 03, 2008 1:40 pm

Re: Menu not working when part of a PHP include file

Post by ccuscMilonic »

Actually, I'm using the image menu. Thank you.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Menu not working when part of a PHP include file

Post by Ruth »

Hi,

I think we will need the url to see what's going on, can you provide one please?

Ruth
ccuscMilonic
Beginner
Beginner
Posts: 3
Joined: Tue Jun 03, 2008 1:40 pm

Re: Menu not working when part of a PHP include file

Post by ccuscMilonic »

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.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Menu not working when part of a PHP include file

Post by Ruth »

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://milonic.com/support/

Ruth
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Re: Menu not working when part of a PHP include file

Post by Andy »

Hi,

Try accessing the include file directly (if you can) like this: http://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
Post Reply