Support

  1. chen-hui-ching
  2. Support
  3. Wednesday, October 12 2016, 10:54 AM
Hello

I have a complex problem, and I try to describe it in detail.

My client needs a multilanguage web including Chinese and English with a member system as a industry directory which can display the members' company name, Telephone, Email and products...etc for people to browse.

When people browse the Chinese web frontend, the easyprofile user list displays the user information in Chinese including the fields and contents, then when browsing the English web frontend, the user list displays the user information in English including the fields and contents, so far I have completed the Chinese web and the member system by easyprofile, it works well in Chinese web frontend.

In the next step I will build the English web by joomla language feature but I do not know how to make the easyprofile to meet my client's needs.

I know the easyprofile fields can be translated by joomla built in language overide, but in my case there are contents in different languages.

So I creat two groups of fields, one is for Chinese contents and another is for English contents. please see the screenshot1.png.

The firstname field is already used for company name in Chinese, so the user list can display the company name for people to click to see the user detail. please see the screenshot2.png and screenshot3.png.

Now if I create another text field for company name in English, but it is not the firstname of joomla core field because the firstname field is used for Chinese content. it can not link to the user detail.

And in the user detail page, the firstname field is in its position, not be replaced by the field I created for company name in English, please see the screenshot4.png.
How to make it meet my needs ?

And how to make the groups of fields I created show/hide depends on the web frontend, such like the Chinese frontend displays the detail fields in Chinese and the English frontend displays the detail fields in English ?

Thank you.
chen-hui-ching Accepted Answer
Pro
yes ! it works !

thank you for your great supporting !
  1. more than a month ago
  2. Support
  3. # 1
admin Accepted Answer
Admin
Hi,
for checkboxes field type try these:

jform[industry_en][]
jform[industry][]


for core email field try this:

jform[email1]


Why this behavior?
because it exclude fields based on form name and not alias of field.

and how to remove the fields group when the related fields are removed ?
Fieldsgroups should become hidden when empty.
  1. more than a month ago
  2. Support
  3. # 2
chen-hui-ching Accepted Answer
Pro
great ! thank you very much ! this way almost works but there are still some problems...

if the web frontend is Chinese, the English content fields are removed except the checkbox field which alias is "industry_en", and when the web frontend is English, the Chinese content fields are removed except the usermail field which alias is "email" and the checkbox field which alias is "industry". why ?

and how to remove the fields group when the related fields are removed ?

please see the member-cn.png and member-en.png and you may understand what I mean.

thank you.
  1. more than a month ago
  2. Support
  3. # 3
admin Accepted Answer
Admin
Hi,
the only way is to override profile page because as title is shown a format name (composed by firstname+lastname).

But, I'm thinking about a very simple solution for you, try to follow these steps:
- Override Profile Page: copy /components/com_jsn/views/profile/default.php into /templates/your-template-folder/html/com_jsn/profile/default.php
- Open new File
- add at line 24 add this code

$lang = JFactory::getLanguage()->getTag();
if($lang == 'en-GB') {
// ENGLISH
$user->name = $user->lastname; // this replace name with lastname (company name in english)
$this->excludeFromProfile[]='jform[field_chinese_alias1]'; // remove field_chinese_alias1 field
$this->excludeFromProfile[]='jform[field_chinese_alias2]'; // remove field_chinese_alias2 field
$this->excludeFromProfile[]='jform[field_chinese_alias3]'; // remove field_chinese_alias3 field
$this->excludeFromProfile[]='jform[field_chinese_alias4]'; // remove field_chinese_alias4 field
$this->excludeFromProfile[]='jform[field_chinese_alias5]'; // remove field_chinese_alias5 field
$this->excludeFromProfile[]='jform[field_chinese_alias6]'; // remove field_chinese_alias6 field
}
else {
// CHINESE
$user->name = $user->firstname; // this replace name with firstname (company name in chinese)
$this->excludeFromProfile[]='jform[field_english_alias1]'; // remove field_english_alias1 field
$this->excludeFromProfile[]='jform[field_english_alias2]'; // remove field_english_alias2 field
$this->excludeFromProfile[]='jform[field_english_alias3]'; // remove field_english_alias3 field
$this->excludeFromProfile[]='jform[field_english_alias4]'; // remove field_english_alias4 field
$this->excludeFromProfile[]='jform[field_english_alias5]'; // remove field_english_alias5 field
$this->excludeFromProfile[]='jform[field_english_alias6]'; // remove field_english_alias6 field
}

replace field_chinese_alias1, field_chinese_alias2,.... with alias of chinese fields
replace field_english_alias1, field_english_alias2,.... with alias of english fields

This should met all your requirements ;)
  1. more than a month ago
  2. Support
  3. # 4
chen-hui-ching Accepted Answer
Pro
ok, I know.

finally I figure out a compromise way that I enable the name style to firstname and lastname then make the firstname for company name in Chinese, the lastname for company name in English.

in the user list, I can set fields I want to display the English content, I set the lastname field for company name in English and it can link to the profile page. please see the member1.png.

and in the profile page, displaying all fields including Chinese and English content, is it appropriate for an English-speaking countries people to understand the information without strange ?

furthermore, is it possible to make the firstname and lastname break into two rows not in a line ? please see the member2.png and you may understand what I mean.

thank you.
  1. more than a month ago
  2. Support
  3. # 5
admin Accepted Answer
Admin
Hi,
Profile page
the only way is to override Easy Profile profile page and add code to show your fields based on Joomla frontend language.

Keep in mind that something like this require many PHP and Joomla Dev knowledges and we does not support custom code.

Users Lists
Joomla allow to set language for menu items, so you can create a users list menu item for each language and set which field to be displayed
  1. more than a month ago
  2. Support
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Request Support

Support is currently Offline

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.