Note: original & new inside the code.
My issue here is that the original "parent" is not very SEO friendly and does not act according to plan, it also does not get fetched up in sitemaps.
However the new is SEO friendly, will get picked up in sitemaps and will be according to plan in the end.
I need it to be a link so that you can see both the navigation menu to the left with the name of each menu / sub-menu and in the center of the page have a picture with the name for each sub-menu depending on which parent you click in the navigation menu on the left.
With the new line added i get a page refresh due to the link, so the sub-menus only flash open for a second before the refresh.
What i need help solving is:
-Making the sub-menu stay open during page refresh so you can use both the navigation from the sidebar navigation and the center navigation.
Thanks in beforehand!
//Jim
This is my current menu:
<div id="container">
<dl>
<?php
$select_category = mysql_query("SELECT * FROM menu WHERE hidden = 0 ORDER BY menu ASC");
while($ln = mysql_fetch_array($select_category)){
$idcat = $ln['nmr'];
$catname = str_replace(' ', '-', $ln['menu']);
?>
*Original*: <dt><a href="#/<?php echo $catname; ?>/" style="color:#000;" ><strong><?php echo $ln['menu']; ?></strong></a></dt>
*New*: <dt><a href="http://www.mysite.com/cats/<?php echo $msub['nmr'];?>/<?php echo $mname; ?>/" style="color:#000;" ><strong><?php echo $mn['menu']; ?></strong></a></dt>
<?php
$select_sub = mysql_query("SELECT * FROM submenu WHERE nmrmenu = '$idcat' AND hidden = 0");
if(mysql_num_rows($select_sub) == 0){
}else {
?>
<dd>
<ul>
<?php
while($lsub = mysql_fetch_array($select_sub)){
$subname = str_replace(' ', '-', $lsub['submenu']);
$pil = '»';
$brnr = $lsub['nmr'];
?>
<li> <a href="http://www.mysite.com/cat/<?php echo $lsub['nmr'];?>/<?php echo $subname; ?>/" style="color:#333;"> <?php echo $pil; ?> <?php echo $lsub['submenu']; ?></a></li>
<?php } ?>
</ul>
</dd>
<?php } ?>
</dl>
<?php } ?>
</div>
CSS:
#container{ margin:auto; margin-left:10px; }
dl, dt, dd, ul, li, a{ margin:0; padding:0; }
a{ text-decoration: none; color:#0F0; }
li{ padding-left:.6em; list-style-type:none; color:#FF0; }
dl{ width:100px; }
dt{ }
JS:
$(function()
{
$("dd:not(first)").hide();
$("dt a").click(function()
{
$("dd").slideUp("normal");
$(this).parent("dt").next("dd").slideDown("normal");
});
});
Here's a jsFiddle of my code.