Creating a dynamic drop down menu

13 posts by 2 authors in: Forums > CMS Builder
Last Post: January 24, 2014   (RSS)

By drewh01 - January 23, 2014

I have created this before, with the help of the forum of course...but I cannot get it to work again. At this point, I am not sure what I am doing wrong so going to start over from the beginning.

Attached is my nav file with working <LI> and <UL> structure.

I have created this same category menu type structure in my admin (tablename=pages1).

Oh, I also need to keep a line of code that lets me override a menu URL and follow a manual link. <?php if ($listRecord['url']) { $listRecord['_link'] = $listRecord['url']; } ?>

Below is what I tried to use, and failed miserably.

TRY #1:

<ul class="sf-menu" id="example">

<?php foreach ($pages1Records as $listRecord): ?>
<?php if ($listRecord['url']) { $listRecord['_link'] = $listRecord['url']; } ?>
<?php $isSelected = ($listRecord['num'] == $detailRecord['num']); ?>
<?php if ($isSelected) { print "<b>"; } ?>
<li><a href="<?php echo htmlencode($listRecord['_link']) ?>"><?php echo htmlencode($listRecord['name']) ?></a></li>

<?php if ($isSelected) { print "</b>"; } ?>
<?php endforeach ?>

<?php if (!$pages1Records): ?>
No records were found!<br/><br/>
<?php endif ?>

</ul>

 TRY #2:

---------

list($allPages, $selectedPage) = getCategories(array(
'tableName' => 'page1',
'categoryFormat' => 'twolevel', // showall, onelevel, twolevel, breadcrumb
));

----------

<ul>
<?php foreach ($allPages as $page): ?>

<?php $link = $page['url'] ? $page['url'] : $page['_link']; ?>

<?php echo $page['_listItemStart'] ?>

<?php if ($page['_isSelected']): ?>

<a href="<?php echo $link; ?>"><?php echo $page['name'] ?></a>

<?php else: ?>

<li>
<a href="<?php echo $link; ?>">
<?php echo $page['name'] ?>
</a>

<?php endif; ?>
<?php echo $page['_listItemEnd'] ?>

<?php endforeach; ?>
</ul>

This is beyond my knowledge and would appreciate some help.

Attachments:

nav_003.php 2K

By drewh01 - January 24, 2014

wow - that's huge. Looks very nice.

i tried to pull this part of the code that I thought was relevant to what I am trying to do and modified it to match my category table:  pages1

But - I get this error:  Notice: Undefined variable: pages1NavRecords in /home/illumina/public_html/includes/nav.php on line 4 Warning: Invalid argument supplied for foreach() in /home/illumina/public_html/includes/nav.php on line 4

---------------------------
<div id="nav">

<ul class="sf-menu" id="example">
<?php foreach ($pages1NavRecords as $categoryRecord): ?>
<li><?php if ($categoryRecord['depth'] == 0): ?>
<?php if ($categoryRecord['redirect'] && $categoryRecord['open_redirect_in_new_window'] =='1'): ?>
<!-- redirect -->
<a href="<?php echo ($categoryRecord['redirect']) ?>" rel="nofollow" target="_blank" title="<?php echo $categoryRecord['name'] ?>"><?php echo $categoryRecord['name'] ?></a>
<!-- /redirect -->
<?php elseif ($categoryRecord['redirect'] && !$categoryRecord['open_redirect_in_new_window'] =='1'): ?>
<!-- redirect -->
<a href="<?php echo $categoryRecord['redirect'] ?>"><?php echo $categoryRecord['name'] ?></a>
<!-- /redirect -->
<?php else: ?>
<a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a>
<?php endif ?>
<?php $parent=$categoryRecord['num'];?>
<ul>
<?php foreach ($pages1NavRecords as $categoryRecord): ?>
<?php if ($categoryRecord['parentNum'] == $parent): ?>
<?php if ($categoryRecord['redirect'] && $categoryRecord['open_redirect_in_new_window'] =='1'): ?>
<!-- redirect -->
<li><a href="<?php echo ($categoryRecord['redirect']) ?>" rel="nofollow" target="_blank" title="<?php echo $categoryRecord['name'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
<!-- /redirect -->
<?php elseif ($categoryRecord['redirect'] && !$categoryRecord['open_redirect_in_new_window'] =='1'): ?>
<!-- redirect -->
<li><a href="<?php echo $categoryRecord['redirect'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
<!-- /redirect -->
<?php else: ?>
<li><a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
<?php endif ?>
<?php endif ?>
<?php endforeach; ?>
</ul>
<?php endif ?><?php break; ?>
</li>
<?php endforeach; ?>

</ul>
<p style="clear:both;">&nbsp;</p>

</div><!--end nav-->

By Mikey - January 24, 2014 - edited: January 24, 2014

Can you include a little more code showing what you placed within the nav.php and how you linked to the nav.php as the include/nav.php ... we're looking for what's producing the error on line 4. Also, I've never actually used a number in a record name before such as "page1" and I'm a bit curious if that may be part of the issue or not... maybe someone else can confirm that's it's okay to use a number in a category section editor name.

But the code you have used all looks good at a double glance over, so I think there's something conflicting in your :

<?php require_once("includes/navRecords.php"); ?>

By drewh01 - January 24, 2014

Attached is my nav.php file and below is my load records. I also changed the 'pages1' --> to 'pages' and removed the number just in case.

<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */

// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/illumina/public_html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

// load record from 'home_page_content'
list($home_page_contentRecords, $home_page_contentMetaData) = getRecords(array(
'tableName' => 'home_page_content',
'where' => '', // load first record
'loadUploads' => true,
'allowSearch' => false,
'limit' => '1',
));
$home_page_contentRecord = @$home_page_contentRecords[0]; // get first record
if (!$home_page_contentRecord) { dieWith404("Record not found!"); } // show error message if no record found

// load detail record from 'pages'
list($pagesRecords, $pagesMetaData) = getRecords(array(
'tableName' => 'pages',
'where' => whereRecordNumberInUrl(1), // If no record # is specified then latest record is shown
'loadUploads' => true,
'allowSearch' => false,
'limit' => '1',
));

$detailRecord = @$pagesRecords[0]; // get first record
if (!$detailRecord) { dieWith404("Record not found!"); } // show error message if no record found

?>

Attachments:

nav_004.php 3K

By Mikey - January 24, 2014

I think I see where the issue is... you're not calling to the pageNavRecords used in the actual navigation. See the code below and I think it will fix things up for you.

<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
 /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */

 // load viewer library
 $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
 $dirsToCheck = array('/home/illumina/public_html/','','../','../../','../../../');
 foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
 if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }


// load record from 'home_page_content'
 list($home_page_contentRecords, $home_page_contentMetaData) = getRecords(array(
 'tableName' => 'home_page_content',
 'where' => '', // load first record
 'loadUploads' => true,
 'allowSearch' => false,
 'limit' => '1',
 ));
 $home_page_contentRecord = @$home_page_contentRecords[0]; // get first record
 if (!$home_page_contentRecord) { dieWith404("Record not found!"); } // show error message if no record found

 // load detail record from 'pages'
 list($pagesRecords, $pagesMetaData) = getRecords(array(
 'tableName' => 'pages',
 'where' => whereRecordNumberInUrl(1), // If no record # is specified then latest record is shown
 'loadUploads' => true,
 'allowSearch' => false,
 'limit' => '1',
 ));

 $detailRecord = @$pagesRecords[0]; // get first record
 if (!$detailRecord) { dieWith404("Record not found!"); } // show error message if no record found


    // load records pages
    list($pagesNavRecords, $selectedCategory) = getCategories(array(
    'tableName'   => 'pages',
    'categoryFormat' => 'showall'
    //'categoryFormat' => 'onelevel' // showall, onelevel, twolevel
  ));


?>

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>SuperMenu</title>

<link rel="stylesheet" type="text/css" href="css/supermenu.css" media="screen" />

<!-- scripts -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/hoverIntent.js"></script>
        <script type="text/javascript" src="js/supermenu.js"></script>
        <script type="text/javascript">
        // http://users.tpg.com.au/j_birch/plugins/superfish/#download
        // initialise plugins
        jQuery(function(){
            jQuery('ul.sf-menu').superfish();
        });

</script>

</head>

<body>

<div id="navigation">
    
    <ul class="sf-menu" style="min-width:980px;"><!-- supermenu -->   

        <?php foreach ($pagesNavRecords as $categoryRecord): ?> 
    <li><?php if ($categoryRecord['depth'] == 0): ?> 
    <?php if ($categoryRecord['redirect'] && $categoryRecord['open_redirect_in_new_window'] =='1'): ?>
    <!-- redirect -->
    <a href="<?php echo ($categoryRecord['redirect']) ?>" rel="nofollow" target="_blank" title="<?php echo $categoryRecord['name'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <!-- /redirect -->
    <?php elseif ($categoryRecord['redirect'] && !$categoryRecord['open_redirect_in_new_window'] =='1'): ?>
    <!-- redirect -->
        <a href="<?php echo $categoryRecord['redirect'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <!-- /redirect -->
    <?php else: ?>
        <a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <?php endif ?>
     <?php $parent=$categoryRecord['num'];?>
         <ul>
        <?php foreach ($pagesNavRecords as $categoryRecord): ?> 
        <?php if ($categoryRecord['parentNum'] == $parent): ?> 
            <?php if ($categoryRecord['redirect'] && $categoryRecord['open_redirect_in_new_window'] =='1'): ?>
            <!-- redirect -->
            <li><a href="<?php echo ($categoryRecord['redirect']) ?>" rel="nofollow" target="_blank" title="<?php echo $categoryRecord['name'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <!-- /redirect -->
            <?php elseif ($categoryRecord['redirect'] && !$categoryRecord['open_redirect_in_new_window'] =='1'): ?>
            <!-- redirect -->
            <li><a href="<?php echo $categoryRecord['redirect'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <!-- /redirect -->
            <?php else: ?>
            <li><a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <?php endif ?>
        <?php endif ?> 
        <?php endforeach; ?>
        </ul> 
    <?php endif ?><?php break; ?>
    </li>
    <?php endforeach; ?>
    
    
    <li><a href="drills_and_drillbits.php" title="Drills &amp; Drill Bits">Drills &amp; Drill Bits</a>
        <ul>
            <li><a href="drills.php" title="Drills" class="nav-common">Drills</a></li>
            <li><a href="drill_bits.php" title="Drill Bits" class="nav-common">Drill Bits</a></li>
        </ul>
    </li>
    
    <li><a href="contact.php" title="Contact">Contact</a></li>
       
    <!-- /supermenu --></ul>
    
    
    <div class="sf-menu-clear"></div>
      <!-- /navigation --></div>
    
    <div style="clear:both"></div><br />
    
    <h1>This has worked well for me and has some fairly neat functions built into it. I think I've got everything packaged up in the zip file that you'll need to get this function.</h1>
<h2 style="font-weight:200;">In your category record create a <strong>text</strong> field type called "<strong>redirect</strong>".<br>
In your category record create a <strong>check box</strong> field type called "<strong>open_redirect_in_new_window</strong>".</h2>

<p>These two fields provide a solution to <strong>redirect</strong> your category page to a different site page within your website. You can also click the check box to <strong>launch the redirect into a new window</strong> for websites that may not be part of the website you're building, such as a link to LinkedIn, Tumblr, Twitter and that colossal waste of time - the dinosaur called Facebook, looking forward to it's extinction.</p>

</body>
</html>

By drewh01 - January 24, 2014

Perfect!  The error message is gone, but now only the first menu item (HOME) is showing, the others are not appearing.

By Mikey - January 24, 2014

So this navigation structure was originally built to use one top tier parent category, with subcategories to create the secondary site pages of the singular parent category page. Then I created an entirely new category in the section editor for my next set of site pages. But you could try adding a second top tier with sub pages to the same "pages" section record such as seen below and see if it creates your second top tier navigation:

Parent Top Tier

  • Sub page
  • Sub page two
  • Sub page three

Parent Top Tier 2

  • Sub page of 2
  • Sub page two of 2
  • Sub page three of 2

If that doesn't work, then you could follow my method which this was built for and powered by individual category pages per section of the site, with sub categories of a single parent category. Such as seen below:

Products (your first category section editor record)

  • Sub page one of Products
  • Sub page two of Products
  • Sub page three of Products

Services (your second category section editor record)

  • Sub page of Services
  • Sub page two of Services
  • Sub page three of Services

And you'd load these as so:

    // load records products
    list($productsNavRecords, $selectedCategory) = getCategories(array(
    'tableName'   => 'products',
    'categoryFormat' => 'showall'
    //'categoryFormat' => 'onelevel' // showall, onelevel, twolevel
  ));

    // load records services
    list($servicesNavRecords, $selectedCategory) = getCategories(array(
    'tableName'   => 'services',
    'categoryFormat' => 'showall'
    //'categoryFormat' => 'onelevel' // showall, onelevel, twolevel
  ));

and your navigation would look like this:

<div id="navigation">
    
    <ul class="sf-menu" style="min-width:980px;"><!-- supermenu -->   

        <?php foreach ($productsNavRecords as $categoryRecord): ?> 
    <li><?php if ($categoryRecord['depth'] == 0): ?> 
    <?php if ($categoryRecord['redirect'] && $categoryRecord['open_redirect_in_new_window'] =='1'): ?>
    <!-- redirect -->
    <a href="<?php echo ($categoryRecord['redirect']) ?>" rel="nofollow" target="_blank" title="<?php echo $categoryRecord['name'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <!-- /redirect -->
    <?php elseif ($categoryRecord['redirect'] && !$categoryRecord['open_redirect_in_new_window'] =='1'): ?>
    <!-- redirect -->
        <a href="<?php echo $categoryRecord['redirect'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <!-- /redirect -->
    <?php else: ?>
        <a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <?php endif ?>
     <?php $parent=$categoryRecord['num'];?>
         <ul>
        <?php foreach ($productsNavRecords as $categoryRecord): ?> 
        <?php if ($categoryRecord['parentNum'] == $parent): ?> 
            <?php if ($categoryRecord['redirect'] && $categoryRecord['open_redirect_in_new_window'] =='1'): ?>
            <!-- redirect -->
            <li><a href="<?php echo ($categoryRecord['redirect']) ?>" rel="nofollow" target="_blank" title="<?php echo $categoryRecord['name'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <!-- /redirect -->
            <?php elseif ($categoryRecord['redirect'] && !$categoryRecord['open_redirect_in_new_window'] =='1'): ?>
            <!-- redirect -->
            <li><a href="<?php echo $categoryRecord['redirect'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <!-- /redirect -->
            <?php else: ?>
            <li><a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <?php endif ?>
        <?php endif ?> 
        <?php endforeach; ?>
        </ul> 
    <?php endif ?><?php break; ?>
    </li>
    <?php endforeach; ?>
    
    
    <li><a href="drills_and_drillbits.php" title="Drills &amp; Drill Bits">Drills &amp; Drill Bits</a>
        <ul>
            <li><a href="drills.php" title="Drills" class="nav-common">Drills</a></li>
            <li><a href="drill_bits.php" title="Drill Bits" class="nav-common">Drill Bits</a></li>
        </ul>
    </li>

<?php foreach ($servicesNavRecords as $categoryRecord): ?> 
    <li><?php if ($categoryRecord['depth'] == 0): ?> 
    <?php if ($categoryRecord['redirect'] && $categoryRecord['open_redirect_in_new_window'] =='1'): ?>
    <!-- redirect -->
    <a href="<?php echo ($categoryRecord['redirect']) ?>" rel="nofollow" target="_blank" title="<?php echo $categoryRecord['name'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <!-- /redirect -->
    <?php elseif ($categoryRecord['redirect'] && !$categoryRecord['open_redirect_in_new_window'] =='1'): ?>
    <!-- redirect -->
        <a href="<?php echo $categoryRecord['redirect'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <!-- /redirect -->
    <?php else: ?>
        <a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <?php endif ?>
     <?php $parent=$categoryRecord['num'];?>
         <ul>
        <?php foreach ($servicesNavRecords as $categoryRecord): ?> 
        <?php if ($categoryRecord['parentNum'] == $parent): ?> 
            <?php if ($categoryRecord['redirect'] && $categoryRecord['open_redirect_in_new_window'] =='1'): ?>
            <!-- redirect -->
            <li><a href="<?php echo ($categoryRecord['redirect']) ?>" rel="nofollow" target="_blank" title="<?php echo $categoryRecord['name'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <!-- /redirect -->
            <?php elseif ($categoryRecord['redirect'] && !$categoryRecord['open_redirect_in_new_window'] =='1'): ?>
            <!-- redirect -->
            <li><a href="<?php echo $categoryRecord['redirect'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <!-- /redirect -->
            <?php else: ?>
            <li><a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <?php endif ?>
        <?php endif ?> 
        <?php endforeach; ?>
        </ul> 
    <?php endif ?><?php break; ?>
    </li>
    <?php endforeach; ?>
    
    <li><a href="contact.php" title="Contact">Contact</a></li>
       
    <!-- /supermenu --></ul>
    
    
    <div class="sf-menu-clear"></div>
      <!-- /navigation --></div>
    
    <div style="clear:both"></div><br />

See where this is going?

By drewh01 - January 24, 2014

Yes, I have a single category viewer page which has a structure like the attached. I'd like to keep everything contained in that one area so I can re-order the nav display for the site within the CMS. I have done this before, but am a bit limited with my knowledge so thanks for helping me out.

By Mikey - January 24, 2014

Okay, so you'll be using a single category, with multiple top tiers and each top tier may have x amount of sub category pages under them. The top teirs will be what appears in the main navigation across the top. And below is the fix to make this work. Just delete the instance of  <?php break; ?>  as seen in bold below and you should be set.

<div id="navigation">
    
    <ul class="sf-menu" style="min-width:980px;"><!-- supermenu -->   

        <?php foreach ($productsNavRecords as $categoryRecord): ?> 
    <li><?php if ($categoryRecord['depth'] == 0): ?> 
    <?php if ($categoryRecord['redirect'] && $categoryRecord['open_redirect_in_new_window'] =='1'): ?>
    <!-- redirect -->
    <a href="<?php echo ($categoryRecord['redirect']) ?>" rel="nofollow" target="_blank" title="<?php echo $categoryRecord['name'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <!-- /redirect -->
    <?php elseif ($categoryRecord['redirect'] && !$categoryRecord['open_redirect_in_new_window'] =='1'): ?>
    <!-- redirect -->
        <a href="<?php echo $categoryRecord['redirect'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <!-- /redirect -->
    <?php else: ?>
        <a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <?php endif ?>
     <?php $parent=$categoryRecord['num'];?>
         <ul>
        <?php foreach ($productsNavRecords as $categoryRecord): ?> 
        <?php if ($categoryRecord['parentNum'] == $parent): ?> 
            <?php if ($categoryRecord['redirect'] && $categoryRecord['open_redirect_in_new_window'] =='1'): ?>
            <!-- redirect -->
            <li><a href="<?php echo ($categoryRecord['redirect']) ?>" rel="nofollow" target="_blank" title="<?php echo $categoryRecord['name'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <!-- /redirect -->
            <?php elseif ($categoryRecord['redirect'] && !$categoryRecord['open_redirect_in_new_window'] =='1'): ?>
            <!-- redirect -->
            <li><a href="<?php echo $categoryRecord['redirect'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <!-- /redirect -->
            <?php else: ?>
            <li><a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <?php endif ?>
        <?php endif ?> 
        <?php endforeach; ?>
        </ul> 
    <?php endif ?><?php break; ?>
    </li>
    <?php endforeach; ?>
    
    
    <li><a href="drills_and_drillbits.php" title="Drills &amp; Drill Bits">Drills &amp; Drill Bits</a>
        <ul>
            <li><a href="drills.php" title="Drills" class="nav-common">Drills</a></li>
            <li><a href="drill_bits.php" title="Drill Bits" class="nav-common">Drill Bits</a></li>
        </ul>
    </li>

<?php foreach ($servicesNavRecords as $categoryRecord): ?> 
    <li><?php if ($categoryRecord['depth'] == 0): ?> 
    <?php if ($categoryRecord['redirect'] && $categoryRecord['open_redirect_in_new_window'] =='1'): ?>
    <!-- redirect -->
    <a href="<?php echo ($categoryRecord['redirect']) ?>" rel="nofollow" target="_blank" title="<?php echo $categoryRecord['name'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <!-- /redirect -->
    <?php elseif ($categoryRecord['redirect'] && !$categoryRecord['open_redirect_in_new_window'] =='1'): ?>
    <!-- redirect -->
        <a href="<?php echo $categoryRecord['redirect'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <!-- /redirect -->
    <?php else: ?>
        <a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <?php endif ?>
     <?php $parent=$categoryRecord['num'];?>
         <ul>
        <?php foreach ($servicesNavRecords as $categoryRecord): ?> 
        <?php if ($categoryRecord['parentNum'] == $parent): ?> 
            <?php if ($categoryRecord['redirect'] && $categoryRecord['open_redirect_in_new_window'] =='1'): ?>
            <!-- redirect -->
            <li><a href="<?php echo ($categoryRecord['redirect']) ?>" rel="nofollow" target="_blank" title="<?php echo $categoryRecord['name'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <!-- /redirect -->
            <?php elseif ($categoryRecord['redirect'] && !$categoryRecord['open_redirect_in_new_window'] =='1'): ?>
            <!-- redirect -->
            <li><a href="<?php echo $categoryRecord['redirect'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <!-- /redirect -->
            <?php else: ?>
            <li><a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
            <?php endif ?>
        <?php endif ?> 
        <?php endforeach; ?>
        </ul> 
    <?php endif ?><?php break; ?>
    </li>
    <?php endforeach; ?>
    
    <li><a href="contact.php" title="Contact">Contact</a></li>
       
    <!-- /supermenu --></ul>
    
    
    <div class="sf-menu-clear"></div>
      <!-- /navigation --></div>
    
    <div style="clear:both"></div><br />