Knowledge Base support case for AllWebMenus, abstracted and stripped of all user’s private info.


Initial Email From:
Eric
Initial Email Subject: Allwebmenus variable
Support Case Month: May 2012

I’m trying to pass a variable to a PHP file from allwebmenus.  Is this possible and if so How? 

Eric

Reply From: Likno Customer Support

Dear Eric,

Can you please give me some more info regarding your Use Case? Do you only want to pass a parameter from AllWebMenus to a PHP page, or do you also need to pass a different parameter depending on the current PHP page?

For example if you have a link like:

mypage.php?id=124

This is passing a parameter to the PHP page. Is the parameter value fixed though, or do you want the parameter value to be determined by the PHP?

If the second applies, then you basically need a “dynamic” menu. There are several different ways to achieve this:

1) Using the Server Side Menu API Add-in. This is the most powerful method as it lets you do anything you want, but it requires some programming knowledge as you basically have to build the menu yourself using JavaScript (that is typically generated by your PHP script). For an example of server-side menus, you can have a look here:

http://www.likno.com/addins/dhtml-menu-serverside-example.html

2) Using “Custom Variables”. This is probably the best option if you want only one (or a few) item to be dynamic. You can have a JavaScript variable in your page (e.g. “var myid = 124;”), which you can “write” with PHP, and then use this within AllWebMenus in the Link field value (e.g. “mypage.php?id=<awm:myid>”). You can read more about this method in the Help file if you search the Index for “Custom Variable”:

help custom variables

3) Using a UL/LI menu. This is an easy way to have a fully dynamic menu regarding the content (but it does not allow any customizations regarding the style). In a UL/LI menu, the structure, links etc. of the menu are not defined within AllWebMenus, but are instead parsed from a UL/LI structure in the page. Hence you could use PHP to write the UL/LI structure you want every time. For more details on this, please read the related Help section:

populate menu inside the page through ul li items

Let me know if you need more specific help with something.

Best Regards,
Kostas
Likno Customer Support
www.likno.com
Create any type of javascript menu (CSS menu, drop-down menu, sliding menu), button, html tree, modal window, tooltip, accordion, tab, scroller, jQuery slider or design for your websites!
Like us on Facebook – Follow us on Twitter

Tags: , , , , , , , , , , , , , , , , , , ,