Posted by davidfells81@gm... on May 7, 2009 at 7:11pm
I am trying to recreate this page in a Drupal site here.
I'm trying to determine where and how to modify the view data (if that is in fact what I need to do) to produce this kind of output. I have a CCK type set up w/ all the community information, including state. My view pulls the title and the state name, orders by state asc, title asc. I don't have any idea at this point how I should do this, though it should be noted that I'd like to learn how to do it the "right" way, which is why I'm posting here!
Thanks in advance.
Comments
I resolved this. Not the
I resolved this. Not the most beautiful solution but it works.
<?php
$communities = $variables['view']->result;
$ls = '';
$ts = '';
foreach ($communities as $c) {
$ts = $c->node_data_field_state_field_state_value;
if (!$ts) {
continue;
}
if ($ts != $ls) {
if ($ls != '') {
echo '</ul>';
}
echo '<b>'.$c->node_data_field_state_field_state_value.'</b>';
echo '<ul>';
}
echo '<li><a href="/node/'.$c->nid.'">'.$c->node_title.'</a></li>';
$ls = $ts;
}
?>
where did you place this code?
i think i have a similar need, and i am still getting the hang of where these kind of things would go. template.php?
thanks,
steve