close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Dynamic Nested Menu help

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

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);
?>

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...