close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Dynamic Nested Menu help

Thread began 6/29/2011 9:28 am by Nathan69474 | Last modified 6/30/2011 5:36 pm by Nathan69474 | 1627 views | 7 replies |

Nathan69474

Dynamic Nested Menu help

I’m having a problem using the css menu writer, in creating a dynamic nested level 2 menu.
- I’ve created a dynamic level 1 no probs (from table nav1)
- I’ve added a dynamic level 2 menu, but without any filtering (from table nav2)
... all rollovers show all sub-menu links (I expected this to happen - due to no filtering)
- but when I try and use the ‘nesting’ function for the level 2 menu nothing appears in level 2

I have thoroughly read the help notes as well as the forums. Over the years I’ve got a good feel as to how to edit the webassist wizards as well as where to find raw source code to make unusual additional edits; as such I have gone into the menu.php file and tested the recordset (within dreamweaver) by changing the default value, the recordset test does populate correctly.

I’ve attached a screen print of the wizard conf pages
My tables are:
Table 1 nav1: id, text1, link1
Table 2 nav2: id, text1, link1, page1 .... (page1 is the nav1.id ... ie the parent ID)

id is the unique key field in both tables.
- I have tested my example by including a ‘did’ database field ie DynamicmenuID and populating etc
- but still get no 2nd menu, so I don’t think using ‘id’ is an issue

The field ‘page1’ is effectively the parent id
- ie the same id number as the relevant nav1.id .... nav1.id = nav2.page1

The text1 is the navigation Name, link1 is the page to link to.

Both tables also have fields called 'pos' for position 'nl' navlist online 0 or 1, but these field aren't included in getting the basic information to display. Once basic display is working additional filtered will be added by editing the menu.php outside of the wizard.

Thanks
nathan

Attached Files
css-menu-wizard-screen-prints.pdf
Sign in to reply to this post

Jason ByrnesWebAssist

the problem is caused by your table relations.


lets take a look at the "Creating Dynamic Menus with CSS Menu Writer 2.0" tutorial on the menu writer support page page in the how to's section:
css-menu-writer/

The sample uses the items and itemcategories table from the Blue Sky music tutorial.

the itemcategories table is the parent table, the structure and data looks like this:

itemcategories:
+-------+---------+
| CatID | Catname |
+-------+---------+
| 1 | CD |
--------+---------+
| 2 | Gear |
+-------+---------+


When creating the first level menu, the CatID column is used for the ID column


the structure and data for the items table looks like this

items:
+--------+-----------+-----------------+
| ItemID | ItemCatID | ItemName |
+--------+-----------+-----------------+
| 1 | 1 | Body Double |
+--------+-----------+-----------------+
| 2 | 1 | So Last Season |
+--------+-----------+-----------------+
| 3 | 1 | HotFlash |
+--------+-----------+-----------------+
| 4 | 1 | A-Go-Go |
+--------+-----------+-----------------+
| 5 | 1 | Filtered Light |
+--------+-----------+-----------------+
| 6 | 1 | DV8: Tendencies |
+--------+-----------+-----------------+
| 7 | 2 | Travel Mug |
+--------+-----------+-----------------+
| 8 | 2 | Travel Tote |
+--------+-----------+-----------------+
| 9 | 2 | Ball Cap |
+--------+-----------+-----------------+
| 10 | 2 | Sport Backpack |
+--------+-----------+-----------------+
| 11 | 2 | Knit Cap |
+--------+-----------+-----------------+



In the filtering section when creating the nested table, the ItemCatID column is selected. that column is used to relate the items to the categories

Sign in to reply to this post

Nathan69474

Hi Jason,

Thanks for the example. I had read all the support & forum content, and I'm convinced this is exactly the format I have got set up.

For itemscategories table, I am using a table called nav1
- for fields CatID, CatName
- I am using fields id, text1

every page is a category eg home page is cat1 / about cat2 / contact cat3 etc

For items table I am using a nav2 table
- for fields itemsID, ItemsCatID, ItemsName
- I am using id, page1, text1

I have inserted duplicate columns into my tables using the same field names as in the example. I have set all the items ItemCatID to 2 (so that they all appear under one menu only) but still don't get a secondary menus.

This is a link to the under construction site (built using sculptor).
_page1.php ... _page1.php
- the home page link is the nested attempt
- all other page links are using a menu with no nesting.

On the un-nested menus all the sub menus show on all the rollovers (which is what I expected considering no filtering etc). It's pulling up the correct available links. Attempts to spread across the links as per the item categories on the home page link the nested version.

I honestly don't think I've got the cross referencing wrong, because when I open the recordset up and test/edit the default value in dreamweaver I get the correct results. I've also double checked the database number fields are all int inputs, not varchar !

The wizard configs are as per the screen print in original posting.

I'm sure it's something very simple that I'm missing, could you look at my example link and if you need copies of any of files lets me know.

thanks
nathan

Sign in to reply to this post

Jason ByrnesWebAssist

if you could send a copy of your file, the CSSMenuWriter folder and a dump of the database so I can reproduce the problem locally, I can see where the issue is.

Sign in to reply to this post

Nathan69474

Hi Jason,

I've created a folder with all the info, how can I get it to you. I don't really want to upload it as a public file. Shall I email it to sales@ or I could upload it to a separate folder on my server.

Thanks
Nathan

Hi Jason,

I've emailled a zip file to sales@. Not sure if it might have been trapped in any WebAssist spam filters.

I've was recently talking to Lauren about upgrading to full suite, so I've emailled her to double check and forward it to you.

thanks
nathan

Sign in to reply to this post

Nathan69474

Hi Jason,

I've created 2 new tables in my database and replicated the naming conventions etc.

Here's the basic structure:
itemcategories table and items
CatID Catname Catlink
1 Category 1 _page1.php
2 Category 2 _page2.php

items table and items
ItemID ItemCatID ItemName ItemLink
1 2 Sub-Link1 _page2.php
2 2 Sub-Link2 _page2.php
3 2 Sub-Link3 _page2.php
4 2 Sub-Link4 _page2.php

I've set all the items as Category 2, so that all rollovers are in that category only.

But I get no rollover sub munu.

Could the problem be that the Category menu is the horizontal 'top' menu and the Items menu is a vertical rollover menu. But on unfiltered tests this doesn't seem to be a problem.

Thanks
Nathan

menu.php file extract:

<?php
mysql_select_db($database_content, $content);
$query_menuwriter_itemcategories = "SELECT Catlink, Catname, CatID FROM itemcategories";
$menuwriter_itemcategories = mysql_query($query_menuwriter_itemcategories, $content) or die(mysql_error());
$row_menuwriter_itemcategories = mysql_fetch_assoc($menuwriter_itemcategories);
$totalRows_menuwriter_itemcategories = mysql_num_rows($menuwriter_itemcategories);
?>
<ul class="level-0" id="cssmw_home">
<?php if ($totalRows_menuwriter_itemcategories > 0) { // Show if recordset not empty ?>
<?php do { ?>
<li class="parent"><a href="<?php echo($assumedRoot); ?><?php echo $row_menuwriter_itemcategories["Catlink"]; ?>"><?php echo $row_menuwriter_itemcategories["Catname"]; ?></a>
<?php
// MenuWriter Nested Filter Variable
$_POST["menuwriter_items_CatID"] = $row_menuwriter_itemcategories["CatID"];
?>
<?php
$MenuWriter_menuwriter_items = "-1";
if (isset($_POST['menuwriter_items_CatID'])) {
$MenuWriter_menuwriter_items = (get_magic_quotes_gpc()) ? $_POST['menuwriter_items_CatID'] : addslashes($_POST['menuwriter_items_CatID']);
}
mysql_select_db($database_content, $content);
$query_menuwriter_items = sprintf("SELECT ItemLink, ItemName, ItemID, ItemCatID FROM items WHERE ItemCatID=%s", GetSQLValueString($MenuWriter_menuwriter_items, "int"));
$menuwriter_items = mysql_query($query_menuwriter_items, $content) or die(mysql_error());
$row_menuwriter_items = mysql_fetch_assoc($menuwriter_items);
$totalRows_menuwriter_items = mysql_num_rows($menuwriter_items);
?>
<ul class="level-1">
<?php if ($totalRows_menuwriter_items > 0) { // Show if recordset not empty ?>
<?php do { ?>
<li><a href="<?php echo($assumedRoot); ?><?php echo $row_menuwriter_items["ItemLink"]; ?>"><?php echo $row_menuwriter_items["ItemName"]; ?></a></li>
<?php } while ($row_menuwriter_items = mysql_fetch_assoc($menuwriter_items)); ?>
<?php } // Show if recordset not empty ?>
</ul>
<?php
mysql_free_result($menuwriter_items);
?>
</li>
<?php } while ($row_menuwriter_itemcategories = mysql_fetch_assoc($menuwriter_itemcategories)); ?>
<?php } // Show if recordset not empty ?>
</ul>
<?php
mysql_free_result($menuwriter_itemcategories);
?>

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

Nathan69474

Hi Jason,

First of all thanks for the time spent helping to create a fix-a-round to the problem.

After we spoke something you said gave me an idea ... 'server not allowing the get id variable post function' to work correctly' ... all my page recordset have a mysql_close(); function. I normally add this after dreamweaver recorset creation process to prevent too many idle database connections. Years ago on a shared server I had server crashing problems.

By removing the close function on my pages, the menus all work perfectly.
So anyone else with a similar problem simply code out or delete ...
// mysql_close(); remove to allow menu-rollover to work

Thanks
Nathan

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...