Re: [greatjakes] Couple of Questions on CMS builder
Hi greatjakes, welcome to the CMS Builder forum! :)
For your first question, yes that's possible. When you have a list viewer you can add a line of code to "filter" the results. So for 2 and 3 that might look like this:
>2. On Principal page, show list of principals only
'where' => ' principal = 1 ',
This assumes you had a checkbox called "principal
>3. On individual practice areas page, we want to
>display only the ones associated with that practice >areas.
'where' => ' practice_area = "corporate" ',
This assumes you had a single value pulldown called "practice_area" with a option for "corporate". You could also do this with multiple checkboxes for practice areas.
And on your second question. There's no easy way to do this without some custom php code. We don't typically include that but here's some that will do that:
<?php
$namesArray = array($record['author1_name'], $record['author2_name'], $record['author3_name']);
$namesArray = array_filter($namesArray); // remove blank names
$names = join(", ", $namesArray); // join names with commas
$names = preg_replace("/(.*),/", '\\1 and', $names); // replace last comma with "and"
?>
<?php echo $names ?>
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com