interior navigation built from cmsb not loading right record

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

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: [craighodges] interior navigation built from cmsb not loading right record

By Chris - September 4, 2009 - edited: September 4, 2009

Hi craighodges,

Without seeing the PHP source code for the entire page I can't know for sure how to solve this, but I can hazard a guess:

I think you want to both get the selected record (from the URL) and a list of all the records in your stu_resources section. Try replacing your STEP 1 code with the following:

<?php

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

list($selected_stu_resourcesRecords, $stu_resourcesMetaData) = getRecords(array(
'tableName' => 'stu_resources',
'where' => whereRecordNumberInUrl(1),
));
$stu_resourcesRecord = @$selected_stu_resourcesRecords[0]; // get first record

list($stu_resourcesRecords, $stu_resourcesMetaData) = getRecords(array(
'tableName' => 'stu_resources',
'loadUploads' => '0',
'orderBy' => 'box ASC',
));

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

?>


I'm still not sure why your links wouldn't work, but let's fix one thing at a time.

If that doesn't help, please post the PHP source code for your entire page as an attachment (or multiple attachments if you're using includes.)
All the best,
Chris

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.