Topic-icon Country and Gender Fields

Active Subscriptions:

None
13 years 11 months ago #23933 by bvtechteam
Hello,
In the your registration flow I do not have the options to choose country and gender fields to import from FB.
Can you please advise how to enable that?
Thank you
The topic has been locked.
Support Specialist
13 years 11 months ago #23941 by alzander
Replied by alzander on topic Country and Gender Fields
What extension are you trying to import into? JFBConnect only allows importing into text-type fields, date, or URL fields. If it's a select box (drop down, radio, checkbox, etc), we don't allow importing into that field. There's no guarantee that the field that Facebook returns will be in your available options list, so it's not possible to import into those types of fields.

Text type fields are meant to have 'unknown' data, so we can import into them. If you need country, we'd recommend making it a text field.

Hope that makes sense,
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 11 months ago #23954 by bvtechteam
Hello Alex,
And thanks again for your clarifying response.
Is there a way to have for example the field of country set as a dropdown menu in the JomSocial registration form (for users who do not want to register with fb) and have it as a text field on your registration form ?
Thank you,
The topic has been locked.
Support Specialist
13 years 11 months ago #23973 by alzander
Replied by alzander on topic Country and Gender Fields
The only way to have both a text and drop-down field would be to create both of those fields, which could get confusing.

If you're interested in *testing* a change that may work for countries, there's a minor code change you can make below. If you edit the /plugins/jfbcprofiles/jomsocial.php file, around line 522, you'll see the following line:
$query = 'SELECT * FROM #__community_fields WHERE type="text" OR type="textarea" OR type="date" OR type="birthdate" ORDER BY ordering';
Update that to the following (adding the --OR type="country"--)
$query = 'SELECT * FROM #__community_fields WHERE type="text" OR type="textarea" OR type="date" OR type="birthdate" OR type="country" ORDER BY ordering';

That will add the Country field to the Field Map area of JFBConnect Profiles. Then, set the correct Country field from Facebook to import into it. It's likely that the countries from Facebook will 'align' with what JomSocial allows, but there may be some countries that don't work perfectly. However, if you expect the majority of your users to come from the 'major' countries, it will hopefully work as expected. Please, please, please test and let us know how well the field gets imported and if it seems correct with the options available in JomSocial!

Some things to look for are is that Facebook (I believe) will return "United States". I don't know what JomSocial uses, but if it's U.S.A or United States of America, that would look like 2 different countries that your users may be from.

Good luck, and keep us posted,
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 11 months ago #23992 by bvtechteam
Hello Alex,
Thank you for the modification details.
I tried it and it seems that it does not pull the current country field. I actually do not see a current country field on my facebook profile. There is only hometown, which also includes country. For example: Sydney, Australia.
With the suggested modification I have received an empty field, it was not populated by facebook.
What do you think?
Thank you,
The topic has been locked.
Support Specialist
13 years 11 months ago #24002 by alzander
Replied by alzander on topic Country and Gender Fields
The field for country is generated by Facebook automatically. Even though it's only one field in your actual profile, they let you pull it through the API separately from the city or state.

You can even test on our demo site or see the country being pulled into a demo profile:
www.sourcecoast.com/jfbconnect/demo/joms...ge/profile?userid=65

I'd recommend trying it with a text field on your site, for now, to see if the right field from Facebook is pulled in. Then, if it's not working in the JomSocial Country Select List, see if the text field that was imported is an available option in your country list in JomSocial. If they don't match exactly, that may be the problem.

Let us know how that goes!
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 11 months ago #24017 by bvtechteam
Hello Alex,
Thank you very much.
The text field indeed solves the problem.
Many thanks,
The topic has been locked.
Support Specialist
13 years 11 months ago #24026 by alzander
Replied by alzander on topic Country and Gender Fields
I hope that got you going. If not, let us know. We have it in our to-do list to look into ways to make the country import work with JomSocial's custom 'country' field, but it's not a high priority and may not even be very possible.

We'll definitely keep you posted on what we find. Until then though, best of luck, and let us know if you need anything else!

Thanks,
Alex
The topic has been locked.