Support

  1. Zephyrinus
  2. Support
  3. Tuesday, March 17 2015, 03:39 PM
Dear EP,

I'm looking for a possibility to show the postal code and city name of the full adress entered in the gmaps location field.

Members will give up their adresses, but I don't want to show the full adress on their profiles for privacy issues.

Can I only show the postal code and city name like: 1054HH, Amsterdam From the location field?

With php perhaps?

The sollution will be very much appriciated!
admin Accepted Answer
Admin
Hi,
sorry for late reply, we were looking for a way to do it.

Unfortunately there is no simple way to do this.

Here our solution
1. Remove string address from map field
- in file /administrator/components/com_jsn/helpers/fields/gmap.php replace line 174 with
return '';

- Now in map field you will see only a map

2. Add postal code and city name in other custom fields
- Create a text field with alias "fieldcity" visible on registration/edit profile/profile
- Create a text field with alias "fieldzipcode" visible on registration/edit profile/profile
- in this example we assumed alias of gmap field equal to "fieldmap" visible on registration/edit profile/profile
- add this code at the end of file /components/com_jsn/assets/js/name.js
jQuery(document).ready(function($){
$('#jform_fieldcity').attr('geo-fieldmap','locality');
$('#jform_fieldzipcode').attr('geo-fieldmap','postal_code');
});

- Now when you register/edit profile fieldcity and fieldzipcode will be filled with data.

Our map field fill in all fields that have the HTML attribute 'geo-alias_of_field', this attribute can have these values:
street_address route intersection political country administrative_area_level_1 administrative_area_level_2 administrative_area_level_3 colloquial_area locality sublocality neighborhood premise subpremise postal_code natural_feature airport park point_of_interest post_box street_number floor room lat lng viewport location formatted_address location_type bounds

We have added this for future improvements.
  1. more than a month ago
  2. Support
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.

Request Support

Support is currently Online

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy Profile® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.