I just started using AllWebMenus Pro version 5.1. Trying to figure out how to generate the Menu execlusivly in code was a challange because in the documentation they had refrences to styles that I could not find in the generated Java Script files I copied to my dev environment.
The Short and Sweet Blog version: The default menu.js will not contain any styles you define or select if you dont create a menu item prior to generating the menu with the AllWebMenus Tool.
In your menu.js or customename_menu.js you will find a function named awBuildMenu() in that function there are style objects that are created and instaciated mostly they are named: its1 for itemstyle1 or grs1 for groupstyle1 etc.
You can use these are you add items to your menu in your code at run time using these styles etc.
Example of Code from my Master Page:
I am going to move this to web service but for the example of a manual generation in your code this explains.
"body>script type="text/javascript">var MenuLinkedBy="AllWebMenus [4]",awmMenuName="membermenu",awmBN="762";awmAltUrl=" ";</script><script charset="UTF-8" src="membermenu.js" type="text/javascript"></script>script type="text/javascript">
<
<!-- DO NOT MOVE! The following AllWebMenus linking code section must always be placed right AFTER the BODY tag-->
<!-- ******** BEGIN ALLWEBMENUS CODE FOR membermenu ******** -->
<
<
awmBuildMenu();
//------- Add your Server-Side code right after this comment ----------
//------- Style Definitions I copied to menu.js after my fake menu generation so I had these
//------- I then generated the menul.js with no menu Items
"its1=new ItemStyle("name=membermenu_itemstyle1;textfont0=Tahoma;textfont1=Tahoma;textfont2=Tahoma;textsize0=11px;textsize1=11px;textsize2=11px;textdecor0=B;textdecor1=B;textdecor2=B;color0=#FFFFFF;color1=#346DA5;color2=#346DA5;padding0=4px 13px 4px 13;padding1=4px 13px 4px 13;padding2=4px 13px 4px 13;bgcolor1=#F6FCFF;bgcolor2=#F6FCFF;border1=none solid solid solid;borderwidth1=0px 1px 1px 1;bordercolor1=#000000 #346DA5 #346DA5 #346DA5;border2=none solid solid solid;borderwidth2=0px 1px 1px 1;bordercolor2=#000000 #346DA5 #346DA5 #346DA5;align0=center;align1=center;align2=center;cursor=hand;leftimage0=Bullet_Orange.gif;leftimage1=Shade_Left.gif;leftimage2=Bullet.gif;rightimage1=Shade_Right.gif");
"its2=new ItemStyle("name=membermenu_itemstyle2;textfont0=Tahoma;textfont1=Tahoma;textfont2=Tahoma;textsize0=11px;textsize1=11px;textsize2=11px;textdecor0=B;textdecor1=B;color0=#E55300;color1=#BC4603;color2=#BC4603;padding0=4px 13px 4px 13;padding1=4px 13px 4px 2;padding2=4px 13px 4px 2;bgcolor0=#F6FCFF;bgcolor1=#C2E1EE;bgcolor2=#C2E1EE;border0=solid;borderwidth0=1;bordercolor0=#346DA5;border1=solid;borderwidth1=1;bordercolor1=#346DA5;border2=solid;borderwidth2=1;bordercolor2=#346DA5;align0=center;align1=center;align2=center;leftimage0=Bullet_Blue.gif");
"grs1=new GroupStyle("name=membermenu_groupstyle1;bgcolor=transparent;type=1;itemdistance=1");
"grs2=new GroupStyle("name=membermenu_groupstyle2;bgcolor=transparent;itemdistance=1;showUnfoldEffect=5;hideUnfoldEffect=5;how=2;hideHow=2;groupoffset=1");
"
"member_I1=membermenu.newItem("style=membermenu_itemstyle1;text0=Home;url=http://geekswithblogs.net/KosherKoder/");
"member_I2=membermenu.newItem("style=membermenu_itemstyle1;text0=Barry;url=http://geekswithblogs.net/KosherKoder/");
"member_I3=membermenu.newItem("style=membermenu_itemstyle1;text0=Joe Montana;url=http://geekswithblogs.net/KosherKoder/");
"
"member_S3=member_I3.newGroup("style=membermenu_groupstyle2");
"member_S3I1=member_S3.newItem("style=membermenu_itemstyle2;text0=Fred");
"member_S3I2=member_S3.newItem("style=membermenu_itemstyle2;text0=Mike");
"member_S3I3=member_S3.newItem("style=membermenu_itemstyle2;text0=Luke");
"
"member_S3SI3=member_S3I3.newGroup("style=membermenu_groupstyle2");
"member_S3SI3I1=member_S3SI3.newItem("style=membermenu_itemstyle2;text0=HERE");
"
"member_S3I3=member_S3.newItem("style=membermenu_itemstyle2;text0=John");
"
"member_I4=membermenu.newItem("style=membermenu_itemstyle1;text0=Mickey;url=");
"member_I5=membermenu.newItem("style=membermenu_itemstyle1;text0=Linda;url=");
"
"member_S5=member_I5.newGroup("style=membermenu_groupstyle2");
"member_S5I1=member_S5.newItem("style=membermenu_itemstyle2;text0=Oranges");
"
"member_I6=membermenu.newItem("style=membermenu_itemstyle1;text0=Linda2;url=");
"if (typeof(membermenu)!="undefined") ProduceMenu(membermenu);
"</script>
"<!-- ******** END ALLWEBMENUS CODE FOR membermenu ******** -->
"
"
"<%--<script type="text/javascript">var MenuLinkedBy="AllWebMenus [4]",awmMenuName="membermenu",awmBN="762";awmAltUrl=" ";</script><script charset="UTF-8" src="http://geekswithblogs.net/KosherKoder/archive/2009/02/13/membermenu.js" type="text/javascript"></script>
"
"<script type="text/javascript">
"
"awmBuildMenu();
"</script>
"<%buildMemberMenu(); %>
"<script type="text/javascript">
"if (typeof(membermenu) != "undefined") ProduceMenu(membermenu);
"
"</script>--%>
PS: The long version will have images when I have time. I only try to blog about problems I have solved that I could not find in Google. There is too much crap to wade through with people blogging for the sake of rates. Barry Shulam
