Filtering list

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

By s2smedia - March 25, 2009

Ok heres my issue...

I have a page that lists "programs"

you can click on a certain "program" and it will take you to a program "details" page

on this details page I would like it to show a listing of the "locations" this program is available in.

* when creating a program in the cms I have a section to select (checkbox) what location this program is available in.

so for example... in my viewer code i would use this:
<?php echo join(', ', getListLabels('programs', 'summer_academy', $programsRecord['summer_academy'])); ?>


The thing i want to do now is actually pull in the location listing and have that filtered by what locations are selected in the above checkbox's

So here would be my code (this lists ALL summer_academy locations, I need it to only list the locations that were selected when creating the program:

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

<table width="300" border="0" cellspacing="0">
<tr>
<td width="68" align="left" valign="top" style="padding:8px 8px 8px 0px"><?php foreach ($record['location_image'] as $upload): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="40" height="30" alt="Locations" /><br/>
<?php endforeach ?></td>
<td width="429" align="left" valign="top" style="padding:10px 0px 10px 0px"><span class="smallsubheader2"> <a href="<?php echo $record['_link'] ?>"><?php echo $record['location'] ?></a></span><br />
<span class="newsheadlines3"><?php echo $record['address'] ?></span></td>
</tr>
</table>

<?php endforeach; ?>

<?php if (!$summer_academy_locationsRecords): ?>
<?php endif ?>

Re: [ross] Filtering list

By s2smedia - March 26, 2009

Hey Ross,

Thanks for the reply.. its a little trickier than that. mainly because the locations and programs are always changing so i cant hard code anything in.

apexsoccer.com

a page you can see what im working on for this particular coding is:
http://www.apexsoccer.com/programs_detailsT.php?Monday-Training-Supplement-16

The box that has the "program locations"...
I need it to only display the locations that offer the particular program page they are viewing.

When setting up a program in the CMS... I have a section that lists all locations and then you check next to each one that offers the program.

Let me know if you have any other ?'s

Thanks!!

Re: [ross] Filtering list

By s2smedia - April 8, 2009

Any word on how i can accomplish this?