geocoder proximity search results modification
5 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: February 7, 2011 (RSS)
By rez - February 6, 2011 - edited: February 6, 2011
I want to put the address, state and zip on one line. Is this possible without a bunch of floats?
Currently, I put each location result in a ul. The address that i want on one line is:
<li><?php if($record['city']):?><?php echo htmlspecialchars($record['city']); ?><?php endif?>
<?php if($record['state']):?><div class="state">, <?php $labels = getListLabels('locations', 'state', $record['state']); echo join('<br/>', $labels); ?></div><?php endif?>
<?php if($record['zipcode']):?> <?php echo htmlspecialchars($record['zipcode']); ?><?php endif?>
</li>
The css state class only changes color. How can I put this all on one line?
Re: [rez] geocoder proximity search results modification
By Jason - February 7, 2011
I noticed that you're using this line:
echo join('<br/>', $labels); ?>
Which will output a <br/> tag after each value in $labels. This is probably why you're seeming it all on multiple lines.
From the look of you're code, it would seem that state is a single value list. Is that right? If so, and if you're using version 2.04 or higher, you can use the pseudo field :label instead of dealing with the getListLabels function. Try this:
<li><?php if($record['city']):?><?php echo htmlspecialchars($record['city']); ?><?php endif?>
<?php if($record['state']):?><div class="state">, <?php echo $record['state:label']; ?></div><?php endif?>
<?php if($record['zipcode']):?> <?php echo htmlspecialchars($record['zipcode']); ?><?php endif?>
</li>
Give that a try. Hope this helps.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] geocoder proximity search results modification
By rez - February 7, 2011
I am using your suggested code and still getting separate lines like this (page source view):
<ul class="list_location">
<li><h3 class="address"> 3611 Washington Blvd.</h3></li>
<li><strong>Distance:</strong> 4.3 miles [Lansdowne Station]</li>
<li>Baltimore
<div class="state">, MD</div>
21227
</li>
<li>410.242.0040</li>
<li>410.242.0044</li>
</ul>
Re: [rez] geocoder proximity search results modification
By Jason - February 7, 2011
If you only need to change the color of the state, instead of using <div> try using <span>
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] geocoder proximity search results modification
By rez - February 7, 2011
Awesome plug-in thanks for your help. Time to work the map in now. :)