Detail page display

6 posts by 3 authors in: Forums > CMS Builder
Last Post: September 10, 2010   (RSS)

Strange one - on one detail page a record which is drawn in from another section works fine but on another detail page (using same page template) this section does not display correctly - can anyone suggest why?

Not working: http://www.blackswan.org.uk/cmsb/fundraising_black_swan_arts_Detail.php?Commissioned-Textile-Prints-of-Black-Swan-Arts-and-Frome-by-Clare-Halifax-2

Warning: Invalid argument supplied for foreach() in /mnt/stor2-wc2-dfw1/436122/www.blackswan.org.uk/web/content/cmsb/fundraising_black_swan_arts_Detail.php on line 177

Working fine:
http://www.blackswan.org.uk/cmsb/fundraising_black_swan_arts_Detail.php?Car-Art-Boot-Sale-1

Thanks!

Re: [Jason] Detail page display

By Chris - September 9, 2010

Please post the complete PHP source code for your fundraising_black_swan_arts_Detail.php page. :)
All the best,
Chris

Re: [chris] Detail page display

Hi Chris,
I'll attach the page so as not to fill the thread with code!:)

Re: [Kittybiccy] Detail page display

Also forgot to add that the exhibitions (current, forthcoming, previous) are displayed using a list option and then a where clause in the php. Not sure if that makes a difference? Thanks!

Re: [Kittybiccy] Detail page display

By Jason - September 10, 2010

Hi,

I think the problem you're having is in this code here:
// load records
list($current_exhibition_thumbRecords, $current_exhibition_thumbMetaData) = getRecords(array(
'tableName' => 'current_exhibition_thumb',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$current_exhibition_thumbRecord = @$current_exhibition_thumbRecords[0]; // get first record


You're selecting an exhibition record based on a record number in the url string. However, the record number in your string is referring to a fund raising record. If the fund raising record number in the url string doesn't match a record in the exhibition table, then the variable $current_exhibition will have no value. Since you're using the "@" symbol, you're suppressing the error message.

You'll need to use a different criteria to select your exhibition record. You could try something like this:
// load records
list($current_exhibition_thumbRecords, $current_exhibition_thumbMetaData) = getRecords(array(
'tableName' => 'current_exhibition_thumb',
'allowSearch' => false,
'limit' => '1',
));
$current_exhibition_thumbRecord = @$current_exhibition_thumbRecords[0]; // get first record


This will just select the first record in your exhibition list (probably the last one added)

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/