wpeloquin
04-09-2012, 03:25 PM
Hello,
I have tried numerous ways, but am beginning to think this not possible (or i'm just stuck looking at it from a single angle), so figured i'd try to get some outside opinions/help.
In my php file, i create an array that looks like the following:
while ($wp_alist = $vbulletin->db->fetch_array($wp_fulllist))
{
$wp_list[$count] = array(
'id' => htmlspecialchars($wp_alist['id']),
'name' => htmlspecialchars($wp_alist['name']),
'locid' => htmlspecialchars($wp_alist['locid']),
'location' => htmlspecialchars($wp_alist['location']),
'url' => htmlspecialchars($wp_alist['url'])
);
$count++;
}
$templater->register('wp_list', $wp_list);
In my template, i can successfully display the entire list using
<vb:each from="wp_list" value="list">
<tr>
<td>{vb:raw list.location}</td>
<td><a href="{vb:raw list.url}">{vb:raw list.name}</a></td>
</tr>
</vb:each>
However, what i would like to do is separate the items based on the location, something similar to the image that i attached. A rough code might be something like this, but i know that vb:raw cannot be used in a conditional, and i cannot figure out how to work around this.
<vb:each from="wp_list" value="location">
<h1>{vb:raw location.location}</h1>
<vb:each from="wp_list" value="list">
<vb:if condition="{vb:raw loc.location} = {vb:raw scroll.location}">
<tr>
<td>{vb:raw list.location}</td>
<td><a href="{vb:raw list.url}">{vb:raw list.name}</a></td>
</tr>
</vb:if>
</vb:each>
</vb:each>
I have tried numerous ways, but am beginning to think this not possible (or i'm just stuck looking at it from a single angle), so figured i'd try to get some outside opinions/help.
In my php file, i create an array that looks like the following:
while ($wp_alist = $vbulletin->db->fetch_array($wp_fulllist))
{
$wp_list[$count] = array(
'id' => htmlspecialchars($wp_alist['id']),
'name' => htmlspecialchars($wp_alist['name']),
'locid' => htmlspecialchars($wp_alist['locid']),
'location' => htmlspecialchars($wp_alist['location']),
'url' => htmlspecialchars($wp_alist['url'])
);
$count++;
}
$templater->register('wp_list', $wp_list);
In my template, i can successfully display the entire list using
<vb:each from="wp_list" value="list">
<tr>
<td>{vb:raw list.location}</td>
<td><a href="{vb:raw list.url}">{vb:raw list.name}</a></td>
</tr>
</vb:each>
However, what i would like to do is separate the items based on the location, something similar to the image that i attached. A rough code might be something like this, but i know that vb:raw cannot be used in a conditional, and i cannot figure out how to work around this.
<vb:each from="wp_list" value="location">
<h1>{vb:raw location.location}</h1>
<vb:each from="wp_list" value="list">
<vb:if condition="{vb:raw loc.location} = {vb:raw scroll.location}">
<tr>
<td>{vb:raw list.location}</td>
<td><a href="{vb:raw list.url}">{vb:raw list.name}</a></td>
</tr>
</vb:if>
</vb:each>
</vb:each>