There is no theme or view function in the contrib modules location_phone or location_fax. And I am not sure how or if the location module gathers up display fields from within the contrib directory.

This is a recurring problem from earlier versions of location, and 5.x-3.0-test2 has the same issue. I am not sure how to apply the earlier suggestions to fix this problem

Katrina

--

www.ambereyes.net

CommentFileSizeAuthor
#11 location.tpl_.php_.patch1001 bytesjenna.tollerson

Comments

ambereyes’s picture

Version: 5.x-3.0-test2 » 5.x-3.0-test3

Okay. I found the problem. Although the api call does pull both the phone and fax values, they were not being processed in the preprocess function, template_preprocess_location, beginning at line 1886 of location.module.

I was not sure what function to use in a module invoke call to add them in programmatically, so I just added them to the list, i.e.

So this starting at line 1918

  foreach (array('street', 'additional', 'city', 'province', 'country', 'postal_code', 'province_name', 'country_name') as $key) {...}
 

became this

   foreach (array('street', 'additional', 'city', 'province', 'country', 'postal_code', 'province_name', 'country_name', 'phone', 'fax') as $key) {...}

I also added the following to the location.tpl.php file

<?php if ($phone) {?>
	<div class="phone">
		<strong>Phone:</strong>
		<?php  echo $phone; ?>
		</div>
		<?php if ($fax) { ?>
		<div class="fax"><strong>Fax:</strong>
			<?php echo $fax; } ?>
	</div>
	<?php }?>

I hope this helps someone else. Obviously, you would need to modify the tpl file to fit your requirements.

bdragon’s picture

Title: Display of Phone & Fax numbers » [master]Display of Phone & Fax numbers
nvoyageur’s picture

I think your </DIV> tags get printed even if there are no phone or fax info. This broke my site layout. I've used the following in location.tpl.php instead and it works when a phone and/or fax is not present.

<?php if ($phone): ?>
<div class="phone"><strong>Phone:</strong><?php print $phone; ?></div>
<?php endif; ?>

<?php if ($fax): ?>
<div class="fax"><strong>Fax:</strong><?php print $fax; ?></div>
<?php endif; ?>
ambereyes’s picture

Yeah, you are right.

My design had the same problem, but I forgot to post the modified version. Sorry!

Your fix matches up with what my designer suggested.

zet’s picture

bdragon, why you did not included this patch in the new version ?

zetxek’s picture

If you want your "Phone" and "Fax" labels to be translatable, just add t() around the labels (it's the way it should be if you have a non-english drupal):

<?php if ($phone): ?>
<div class="phone"><strong><?php print t("Phone")?>:</strong><?php print $phone; ?></div>
<?php endif; ?>
<?php if ($fax): ?>
<div class="fax"><strong><?php print t("Fax");?>:</strong><?php print $fax; ?></div>
<?php endif; ?>
yesct’s picture

Status: Active » Needs work
Issue tags: +Location theming, +location extra location fields like phone etc

Tagging.

Could someone check these are not fixed in the latest dev release and then make a patch http://drupal.org/patch/create

jenna.tollerson’s picture

Version: 5.x-3.0-test3 » 5.x-3.x-dev

I can confirm that this is still not working in the latest dev release.

If I understood exactly what needed to be patched I would try to make one, but the suggestions here (and in the duplicate threads) do not seem to correlate with the latest release, so I feel a little lost.

yesct’s picture

I think the file that needs to be patched is the location.tpl.php

darrenmothersele’s picture

I can confirm that the template_preprocess function is fine, but the changes still need to be made to location.tpl.php as per comment #6.

jenna.tollerson’s picture

StatusFileSize
new1001 bytes

Created a patch against 5.x-3.x-dev.

yesct’s picture

Status: Needs work » Needs review
bdragon’s picture

Version: 5.x-3.x-dev » 6.x-3.x-dev
Status: Needs review » Fixed

Finally fixed.
Integration with the hcard microformat data is in as well.

http://drupal.org/cvs?commit=244076
http://drupal.org/cvs?commit=244078
http://drupal.org/cvs?commit=244080

Status: Fixed » Closed (fixed)
Issue tags: -Location theming, -location extra location fields like phone etc

Automatically closed -- issue fixed for 2 weeks with no activity.