 |

jdancisin
User
Aug 25, 2008, 11:30 AM
Post #1 of 10
(750 views)
Shortcut
|
|
Divide a single list into multiple groups
|
Can't Post
|
|
I have a list of donors, and each belongs to a category. I would like to divide up the list into different sections based on the various categories. - corporate, individuals, legacy, etc... Is there a way to do this using only one section?
|
|
|  |
 |

Dave
Staff
/ Moderator

Aug 25, 2008, 11:47 AM
Post #2 of 10
(747 views)
Shortcut
|
|
Re: [jdancisin] Divide a single list into multiple groups
[In reply to]
|
Can't Post
|
|
Yes, here's the steps: 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. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

jdancisin
User
Aug 25, 2008, 1:10 PM
Post #3 of 10
(741 views)
Shortcut
|
|
Re: [Dave] Divide a single list into multiple groups
[In reply to]
|
Can't Post
|
|
Ok... something is happening, but not I am not sure what:
<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>
|
|
|  |
 |

jdancisin
User
Aug 25, 2008, 1:43 PM
Post #4 of 10
(732 views)
Shortcut
|
|
Re: [jdancisin] Divide a single list into multiple groups
[In reply to]
|
Can't Post
|
|
You know, I don't think I explained myself very well in my original post. Let me try again: 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.
|
|
|  |
 |

Dave
Staff
/ Moderator

Aug 25, 2008, 1:47 PM
Post #5 of 10
(729 views)
Shortcut
|
|
Re: [jdancisin] Divide a single list into multiple groups
[In reply to]
|
Can't Post
|
|
Ok, the first step is to create a mockup of how you want the page to look. Are you able to post an url of the mockup page? Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

jdancisin
User
Aug 25, 2008, 1:51 PM
Post #6 of 10
(728 views)
Shortcut
|
|
Re: [Dave] Divide a single list into multiple groups
[In reply to]
|
Can't Post
|
|
I just figured it out. Thanks.
|
|
|  |
 |

Dave
Staff
/ Moderator

Aug 25, 2008, 1:52 PM
Post #7 of 10
(727 views)
Shortcut
|
|
Re: [jdancisin] Divide a single list into multiple groups
[In reply to]
|
Can't Post
|
|
Great, glad to hear it's working! :) Let us know if you need anything else. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

willbegood
User
Nov 13, 2008, 7:06 PM
Post #8 of 10
(340 views)
Shortcut
|
|
Re: [Dave] Divide a single list into multiple groups
[In reply to]
|
Can't Post
|
|
Just what i was looking for. It takes me 1 minute to find the solution on the forum. You guys are great!!!!
|
|
|  |
 |

jposwald
User
Nov 18, 2008, 8:27 AM
Post #9 of 10
(307 views)
Shortcut
|
|
Re: [Dave] Divide a single list into multiple groups
[In reply to]
|
Can't Post
|
|
Dave, 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.
|
|
|  |
 |

Dave
Staff
/ Moderator

Nov 18, 2008, 1:50 PM
Post #10 of 10
(299 views)
Shortcut
|
|
Re: [jposwald] Divide a single list into multiple groups
[In reply to]
|
Can't Post
|
|
Hi Juan, 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! Dave Edis - Senior Developer interactivetools.com
|
|
|  |
|