Hi there,
Let me explain the layout of my site:
I have a products page which outlines two main products. The outline text is managed through the CMS via a page viewer and a list viewer generates the links for the products. When you click on either product, it takes you to a product_details page viewer which loads the appropriate record.
On all my pages I also have a page viewer to the right side which just has some sidebar text.
Everything works great except that when I click on the second product in the products page (and the URL has record # 2 in it), I get an error at the top as follows:
"Notice: Undefined offset: 0 in /home/content/.../product_details.php on line 22"
Also, the side bar text will then not be visible.
The code at the top of the page is:
"<?php
require_once "/home/content/c/p/a/cpagee/html/cmsAdmin/lib/viewer_functions.php";
list($product_listRecords, $product_listDetails) = getRecords(array(
'tableName' => 'product_list',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$product_listRecord = $product_listRecords[0]; // get first record
list($sidebarRecords, $sidebarDetails) = getRecords(array(
'tableName' => 'sidebar',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$sidebarRecord = $sidebarRecords[0]; // get first record
?>"
It looks to me like the viewer is trying to see record 2, which of course won't exist for a single page viewer. I tried putting this line " $options['recordNum'] = @$listRows[0]['sidebarDetails'];" before the sidebar line to get the first record but no luck. Any help would be appreciated!