Divide a single list into multiple groups
10 posts by 4 authors in: Forums > CMS Builder
Last Post: November 18, 2008 (RSS)
By zip222 - August 25, 2008
- corporate, individuals, legacy, etc...
Is there a way to do this using only one section?
Re: [jdancisin] Divide a single list into multiple groups
By Dave - August 25, 2008
1) Create a mockup of how you want it to look.
2) Create a pulldown field for category (corporate, individuals, legacy, etc) and make that a required field.
3) Sort by category first, then whatever other fields you want to sort by.
4) Then display the category name once above each group like this:
<?php if ($record['category'] != @$lastCategory): ?>
<?php $lastCategory = $record['category']; ?>
<h1><?php echo $record['category'] ?></h2>
<?php endif ?>
Hope that helps, let me know if you run into any problems with that.
interactivetools.com
Re: [Dave] Divide a single list into multiple groups
By zip222 - August 25, 2008
<ul>
<?php foreach ($donor_listRecords as $record): ?>
<?php if ($record['type'] != @$lastCategory): ?>
<?php $lastCategory = $record['type']; ?>
<li><?php echo $record['name'] ?> (<?php echo $record['type'] ?>)</li>
<?php endif ?>
<?php endforeach; ?>
</ul>
Re: [jdancisin] Divide a single list into multiple groups
By zip222 - August 25, 2008
I have created a section that includes a list of donors. For each donor record, I have two fields: 'name' and 'type'. The 'type' field is a dropdown menu that includes four different options.
On the public page, I want to display four different lists of donors - one for each "type". This is what I need help with.
Re: [jdancisin] Divide a single list into multiple groups
By Dave - August 25, 2008
interactivetools.com
Re: [Dave] Divide a single list into multiple groups
By zip222 - August 25, 2008
Re: [jdancisin] Divide a single list into multiple groups
By Dave - August 25, 2008
interactivetools.com
Re: [Dave] Divide a single list into multiple groups
You guys are great!!!!
Re: [Dave] Divide a single list into multiple groups
I really love CMS. It allows me to get my clients very happy, and i'm happy to with that!
I want to make you an answer regarding this item.
I have 2 sections in CMS called "Featured Homes" and "Meet our Team"
I want to put a field under Detailed Property to show which agent of "our team" is seeling that home.
This is the url:
http://www.utahreoexperts.com/featured-homes/detail/?SELLER-MOTIVATED-TOWNHOME-6
I know how to create a pull list field called "Agent" and get it from Get options from database, under "Featured Homes" section.
But Im stuck to get that record and echo into Detailed Property.
What should i do?
Thank you Dave, Juan.
Re: [jposwald] Divide a single list into multiple groups
By Dave - November 18, 2008
The first step is to get the record number of the agent.
Create a pulldown in homes that loads it's values from "team" with num for the value and name for the "label".
Next, try displaying that agent number on the listing page.
Then once that is working you can load that agents record like this:
list($teamRecords, $teamMetaData) = getRecords(array(
'tableName' => 'team',
'where' => "num = '$teamMemberNum' ",
'allowSearch' => false,
));
$agent = @$teamRecords[0]; // get first record
Hope that helps!
interactivetools.com