Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
This is a server issue. You can tell PHP to parse .js files but it's is not advisable.
It's better to rename your .js file as .php. This will then be parsed through the PHP interpreter by your web server thus allowing you to add PHP variables.
Generate the array inside the php page instead of the separate js file.
Include it in your page with <script></script> tags and when you have to put php vars, just call the php interpeter <? and put in the vars.
I use ASP so I don't know the right php syntax but it should be quite easy. It's just you usually generate dyn html, so generate dyn js instead
ok, i put the menu_array.js in the php template header (overall_header.tpl). i don't get any errors, however, it also doesn't work. the {U_GUESTBOOK} variable just shows up as a # sign when you place your mouse over it...
maybe i'm doing the syntax incorrectly. any additional ideas are much appreciated.
I don't know exactly PHP syntax.. sorry... by the way, you would have a PHP page (maybe your header template) with generates te final (X)HTML page right?
So you'll have <? echo "<body><div>" /?> and so on... (sorry maybe the syntax is wrong)
Somewhere you have to put a similar PHP instruction to print off the array (instead of including the .js file)
Something like: <? echo "<script type=""text/javascript""><!--"
"menunum=0;menus=new Array();_d=document;function addmenu(){menunum++;menus[menunum]=menu;}function dumpmenus(){mt=""<s"" + ""cript type=text"" + ""/javascript>"";for(a=1;a<menus.length;a++){mt+="" menu""+a+""=menus[""+a+""];""}mt+=""<\/scr"" + ""ipt>"";_d.write(mt)}"
and here add the array, always using echo or wahtever PHP offers instead of ASP Response.Write:
<? echo "addmenu(menu=["menu20",,,160,1,"",SubSt,0,"left",SubFx,0,0,0,"","","","","",.....
and where you have to put the VAR link just put it.
Hope this helps
has anybody solved this problem (as stated by xMANIGHTx)? this is where i'm stuck, and the menu isn't usable unless i can find some way to deal with this passing of <script type="javascript...
well...i did solve this...i'll post the solution here in case anybody comes across this in the future...
from the menu_array.js file i took out everything below the lines as mentioned previously in this post...
so, beginning with the ///editable properties/// section...i took all of that information and created another file "menu_info.php" and then set up all of my queries in there...
then, i simply call it up in the webpage as another javascript file (yep, with a php file name - it does work)...
voila...and if anybody needs some more help with this i'm happy to help out... jvaska at yahoo dot com ...send me a note...