Combining more than 1 multi-record in a single page?

8 posts by 2 authors in: Forums > CMS Builder
Last Post: April 25, 2011   (RSS)

By (Deleted User) - April 12, 2011

I have a small list of products that I am currently using as individual detail pages, BUT that I'd like to use as a multi-record instead.
http://www.atiintheusa.com/sunpower.php

Problem is that each product contains a "specifications" chart that is currently a multiple record (click on the specifications tab and you will see the multirecord table appear).

Is there an easy way to make the product pages a multirecord page (I know how to do this) but have the specifications table be included somehow? I'd like to keep this table flexible/sortable. But I'd like to easily include it on this page. I spoke with one of your staff who said it was doable, but we didn't go into great detail at the time. Please advise. Thanks.

Re: [kimamel] Combining more than 1 multi-record in a single page?

By robin - April 13, 2011

Hey,

If you want to have more than one multi-record on the same page, you'll need to provide a condition to the second one so it displays the relevant records. I'm not sure what your tables and columns are called, but the code for including "specifications" in a product multi-record should look something like this:

// load records
list($specificationsRecords, $specificationsMetaData) = getRecords(array(
'tableName' => 'specifications',
'where' => "product = '" . $productRecord['num'] . "'
));


Hope that helps. If you're still having trouble you can post or send in to support@interactivetools.com the code you're trying to use and we'll take a look.

Thanks
Robin
Programmer
interactivetools.com

Re: [robin] Combining more than 1 multi-record in a single page?

By (Deleted User) - April 21, 2011

I ended up keeping these as single pages, but am having a similar problem combining a single record field on a multi-record detail page.

'announcements' is the multi record
about is a single record
here's my top code:

============
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php


// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/webadmin/www/atiintheusa/html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

// load records
list($aboutRecords, $aboutMetaData) = getRecords(array(
'tableName' => 'about',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$aboutRecord = @$aboutRecords[0]; // get first record

// load records
list($announcementsRecords, $announcementsMetaData) = getRecords(array(
'tableName' => 'announcements',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$announcementsRecord = @$announcementsRecords[0]; // get first record

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

?>
============

Bottom code is working great all of the articles are appearing as they are supposed to. It is the single record that I am having trouble with, as it only appears on the first record, but won't appear on the others...
<h1><?php echo $aboutRecord['announcements_page_title'] ?></h1>

Where am I going wrong? Here's the remaining code:

====================


<h1><?php echo $aboutRecord['announcements_page_title'] ?></h1>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<h2 style="padding-top:15px;padding-bottom:7px;"><?php echo $announcementsRecord['title'] ?></h2>
<h3><?php echo $announcementsRecord['content'] ?>
<?php if ($announcementsRecord['date']): ?>
<p class="postdate">posted <?php echo date("F d, Y", strtotime($announcementsRecord['date'])) ?></p>
<?php endif ?></h3>
</td>
</tr>
</table>

Re: [kimamel] Combining more than 1 multi-record in a single page?

By robin - April 21, 2011

Hey,

If about is a single record, just remove the 'where' line in the load records and it will always show.

Hope that works for you,
Robin
Robin
Programmer
interactivetools.com

Re: [robin] Combining more than 1 multi-record in a single page?

By (Deleted User) - April 21, 2011

Thank you. I thought I did that, but it was still showing... Working great now though!

Re: [robin] Combining more than 1 multi-record in a single page?

By (Deleted User) - April 21, 2011

Back to the original multiple multi records...

So if my detail page is a template, being used by multiple records, do I have to create this line several times?

For instance, the main multi-record page would be
=========================
// load records
list($water_care_productsRecords, $water_care_productsMetaData) = getRecords(array(
'tableName' => 'water_care_products',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$water_care_productsRecord = @$water_care_productsRecords[0]; // get first record

===================================

So if there are 6 products there, they all have different tables, I assume. And then they each have a different set of multi records to include the specs. These are:

===================================


// load records
list($coral_ocean_specificationsRecords, $coral_ocean_specificationsMetaData) = getRecords(array(
'tableName' => 'coral_ocean_specifications',
));

-=================================

I was told it was possible to include the specifications table within the original multi-listing page and I posted a separate post to the forum about this, as it may be better, but either solution would be fine if I could get it to work.

Re: [kimamel] Combining more than 1 multi-record in a single page?

By robin - April 25, 2011

Hey,

I'm not quite sure what you're asking? Do you want to display all your products on one page or just show one of many possible products?

Thanks,
Robin
Robin
Programmer
interactivetools.com