Bug with Dynamic Menus ?
Some time back I acquired CSS Menu Writer. Have now started to work with it and initial efforts worked fine with a single level dynamic menu.
Once that was working as expected, I attempted to add the nested menu to the top menu. Since the result ended in a total failure, I decided to remove the nested menu and go back to the top level menu and start again.
Somehow, I believe the problem is caused by what I was attempting to achieve during the setting up of the nested menu.
Some background:
I am using a single table for my page data which includes elements such as:
id_pag - The PK field for the page
idpag_pag - A self-foreign key for second level pages - This is left as NULL when no 2nd level page is required.
menulabel_pag - the menu label
urlparam_pag - the URL parameter
.....
.....
active_pag - a Y / N boolean
order_pag - the order in which pages are listed in the menu
The structure is taken from examples suggested by Interakt for their old CSS Menu 2 product which I have used for some time and have adapted to use with Spry. Incidently, the Spry version I have works flawlessly is easy to style and manage. I only need 2 levels of navigation for all my sites, however, I thought that I should give WA CSS Menu Writer a tryout as it has some nice features and may in time develop to the point where it can be more useful for my requirements. - Ray Borduin may recall some discussions on this some time back....
Back to the problem at hand:
With the single level of navigation working I selected the nav code block and opened up the CSS Menu Writer edit menu. I selected the top level menu and then clicked the +Add button, then selected new Dynamic Link.
I then filled out the dialog box and selected the idpag_pag self-foreign key for the Key Column and the rest of the settings I made the same as for the top level.
I noticed that the Filter dropdown list had a new option called Nested. However, I could not find anything that fully described its use. The Help for the product under the section on Creating Dynamic Menu Items is rather thin on the ground and means nothing to me. Maybe I cant grasp some simple notion here, but its meaningless and fails totally to descibe the use of this option.
Nevertheless, I completed the dialog process and loaded the page and support files to my test server, tested the page and was presented with an error message that said: "Unknown column 'Y' in 'where clause'"
I then removed the nested menu, and checked that the settings were correct for the top menu. They were. I relaoded the page and support files and again was presented with the same error. I checked the menu.php file and discovered this line:
$query_menuwriter_pagespag = "SELECT urlparam_pag, menulabel_pag, id_pag, active_pag, order_pag FROM pages_pag WHERE active_pag=Y ORDER BY order_pag ASC";
I spotted the problem with active_pag=Y and changed it to active_pag='Y' and was pleased to see that the top level menu items were working again.
At this point I recalled that I had downloaded 2.0.2 when it was released but had never installed it. So I removed 2.0.1 and installed 2.0.2, setup the same top level dynamic menu and bugger me days !! I had the same error presented to me as before so once again I hand edited menu.php to get the menu to work.
So I believe I have a real bug here in this regard.
That said, I would be delighted to hear from anyone else who has been able to get a dynamic menu to function along the lines of what I have described and to clarify the process for the Nested dynamic menu.