interior navigation built from cmsb not loading right record

5 posts by 2 authors in: Forums > CMS Builder
Last Post: September 4, 2009   (RSS)

Hey guys -

I am building a large site with CMSB (so awesome) I have an issue where the interior subnav is not working:

This is the source page: http://www.tpschool.org/stu/overview.php (a photo gets put in automatically in the blank space in the upper left).

Then when you select one of the sub nav sections: Primary unit for example: http://www.tpschool.org/stu/viewres_stu.php?Primary-Unit-2

The photo is replaced by interior navigation. There is a little phpfile which is building the menu (see below)
<?php

require_once "/usr/www/users/thephila/cmsAdmin/lib/viewer_functions.php";

list($stu_resourcesRecords, $stu_resourcesMetaData) = getRecords(array(
'tableName' => 'stu_resources',
'loadUploads' => '0',
'orderBy' => 'box ASC',
));
$stu_resourcesRecord = @$stu_resourcesRecords[0]; // get first record

// show error message if no matching record is found
if (!$stu_resourcesRecord) {
print "Record not found!";
exit;
}

?>



<table>
<tr>
<td style="width: 300px; vertical-align:top;" >
<table style="width: 100%">
<tr>
<td style="width: 300px; vertical-align:top;" class="subnav_background">
<div id="sub">

<ul>
<li><a href="http://www.tpschool.org/stu/overview.php" class="pad">Student Overview Home</a></li>
<?php foreach ($stu_resourcesRecords as $record): ?>
<li><a href="<?php echo $record['_link'] ?>" class="pad"><?php echo $record['title'] ?></a></li>
<?php endforeach; ?>
</ul>

</div>
</td>

here is the problem. When I leave out the where statement, the interior nav is created correctly but the links don't work. When I put in the where statement, it only creates a link for the subnav page you have selected.

When the where statement is out, it created the link properly in that it is the same as the link from the overview page, it just does not work.

Any help is appreciated.

Craig

Re: [craighodges] interior navigation built from cmsb not loading right record

By Chris - September 3, 2009

Hi Craig,

I'm confused about what the problem is. What is this "where statement" you're referring to?
All the best,
Chris

Re: [chris] interior navigation built from cmsb not loading right record

Sorry Chris - it is this one:

'where' => whereRecordNumberInUrl(1),

when that is in, the menu does not build all the options but the links it builds work. When it is not, it builds all the links but despite the url being correct, they don't work.

Re: [chris] interior navigation built from cmsb not loading right record

You are a genuis Chris - Thanks! It works perfectly. I could not figure it out for the life of me. I knew it had to be something like that but I was banging my head against a wall.

You guys are terrific and I CSMB is absolutely wonderful.

Thanks again.