Creating a list page with information from 2 multi record editors

5 posts by 3 authors in: Forums > CMS Builder
Last Post: June 1, 2009   (RSS)

By gkornbluth - May 25, 2009 - edited: May 29, 2009

Hi All,

Stumped again...

I’m trying to create a list page using information from 2 multi record editors. “Exhibitions”, and “Opening Receptions”.

Both editors pull a check box list of event titles from a master events list multi record editor and the specific event title then is checked on each record in the “Exhibitions” and “Opening Receptions” editors.

The event editor has all of the permanent event information and the other has opening reception information only for those events. (I’m using 2 editors so that the “Opening Reception” information can automatically be hidden after the reception date has passed)

I can’t seem to get the “Opening Reception” information to display with the corresponding event. In spite of the “where” code in the head, all of the “Opening Reception” dates show in each event listing.

I’ve tried a number of approaches and am out of ideas.


The link to the page I’m trying to create is: http://www.lkmix.com/index3.php


Thanks,

Jerry Kornbluth

Here’s the code that I’m using in the head:

<?php

require_once "/hsphere/local/home/craftgallery/lkmix.com/cmsAdmin/lib/viewer_functions.php";

list($exhibitionsRecords, $exhibitionsMetaData) = getRecords(array(

'tableName' => 'exhibitions',

));


list($opening_receptionsRecords, $opening_receptionsMetaData) = getRecords(array(

'tableName' => 'opening_receptions',

'where' => "exhibition LIKE '%" .mysql_real_escape_string(@$_REQUEST['sort_exhibition']). "%'",

));


?>


And in the body (without the styling info):

<table>

<?php foreach ($exhibitionsRecords as $record): ?>

<tr>

<td><a href="<?php echo $record['_link'] ?>"><?php echo $record['exhibition'] ?></a>

<br /><?php echo $record['sub_title'] ?><br />

<br />

Show Dates: <?php echo date("D, M jS", strtotime($record['opening_date'])) ?> - <?php echo date("D, M jS, Y ", strtotime($record['closing_date'])) ?><br />

<?php echo $record['days_and_times'] ?></p><hr color="#C70000" width="300" /<br />Opening Reception: <?php foreach ($opening_receptionsRecords as $record): ?><?php echo date("D, M jS", strtotime($record['reception_date'])) ?><?php endforeach; ?></td>

</tr> <?php endforeach; ?>

</table>
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [ross] Creating a list page with information from 2 multi record editors

By gkornbluth - May 26, 2009 - edited: May 29, 2009

Ross,

Thanks for looking at this.

There are actually only 2 multi record editors:

1) “Exhibitions” that contains the basic information about each exhibition and

“Opening Receptions”that contains the date and time of the opening reception for each exhibition (if any)

Both editors have a field called “exhibition” that contains the name of the exhibition.

I separated the exhibition information from the reception information so that I could automatically “hide” the reception information after the reception date has passed.

As you can see from http://www.lkmix.com/index3.php the exhibition information is displaying correctly, (there are only 2 exhibition records) but instead of the “where” statement limiting the reception date information to that belonging to the specific exhibition, all reception dates show in all of the listings.

I know that I must be doing something pretty lame, but I can’t seem to find what it is.

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [ross] Creating a list page with information from 2 multi record editors

By gkornbluth - May 29, 2009

Hi Ross,

If you have a moment that either you or someone can revisit this, I'd be grateful.

Thanks,

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Creating a list page with information from 2 multi record editors

By Dave - June 1, 2009 - edited: June 1, 2009

Hi Jerry,

Can you email me CMS and FTP login details to dave@interactivetools.com so I can take a look at the setup? That will be the quickest way for me to determine the issue. Note: Email, don't post login details to the forum.

Also, please include a link to this post.

Thanks, hope that helps!
Dave Edis - Senior Developer
interactivetools.com