geocoder proximity search results modification

By rez - February 6, 2011 - edited: February 6, 2011

Hello, I am trying to reformat the search results example.
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">,&nbsp;<?php $labels = getListLabels('locations', 'state', $record['state']); echo join('<br/>', $labels); ?></div><?php endif?>
<?php if($record['zipcode']):?>&nbsp;<?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

Hi,

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">,&nbsp;<?php echo $record['state:label']; ?></div><?php endif?>
<?php if($record['zipcode']):?>&nbsp;<?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

thanks for the label tip.

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>&nbsp;4.3 miles&nbsp;[Lansdowne Station]</li>

<li>Baltimore

<div class="state">,&nbsp;MD</div>
&nbsp;21227
</li>
<li>410.242.0040</li>
<li>410.242.0044</li>

</ul>

Re: [Jason] geocoder proximity search results modification

By rez - February 7, 2011

Oh.. sorry about that. It is a CSS issue.

Awesome plug-in thanks for your help. Time to work the map in now. :)