Can't link to all detail pages

5 posts by 2 authors in: Forums > CMS Builder
Last Post: May 14, 2010   (RSS)

By NigelGordijk - May 14, 2010 - edited: May 14, 2010

Hi, there.

I've set up a multi-page section - http://www.wilmot.ca/departments-clerks-boundaries.php - but only one of the links to details pages works. Try the "Questionnaires" link.

It seems to be the only link that works points to the first record that was added to the cms. I've found it suddenly happening on other multi-page sections on the same site, too.

Any ideas why this might be, please?
Nigel Gordijk

Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net

Re: [Jason] Can't link to all detail pages

Thanks, Jason. Here you go...

I've also attached the index page.
Nigel Gordijk

Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net

Re: [NigelGordijk] Can't link to all detail pages

By Jason - May 14, 2010

Hi,

The records from depts_introduction and contacts_department, are these records supposed to be the same every time the page loads?

What's happening, is you're pulling information from a number of different tables using
"where" => "whereRecordNumberInUrl(1)",

With this, the page will only load when the record number in all 3 tables are the same. The reason why it works for "Questionaire" is that its record number =1.

Try replacing the code where you get depts_introduction and contact_department records with this:

list($contacts_departmentRecords, $contacts_departmentMetaData) = getRecords(array(
'tableName' => 'contacts_department',
'allowSearch'=> false,
'limit' => '1',
));
$contacts_departmentRecord = @$contacts_departmentRecords[0]; // get first record

// show error message if no matching record is found
if (!$contacts_departmentRecord) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}

list($depts_introductionRecords, $depts_introductionMetaData) = getRecords(array(
'tableName' => 'depts_introduction',
'allowSearch'=>false,
'limit' => '1',
));
$depts_introductionRecord = @$depts_introductionRecords[0]; // get first record

// show error message if no matching record is found
if (!$depts_introductionRecord) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}


Give that a try.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Can't link to all detail pages

Perfect! Thanks so much, Jason.
Nigel Gordijk

Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net