Support

  1. czarrna
  2. General
  3. Saturday, March 12 2016, 07:57 PM
Hello,

I have 2 groups - people and companies.

In case of companies I need to hide first- and lastname fields (both required) on the profile list and the profile view.

I do not want companies to be listed by first and last name of a person who will be registering particular company.

Is there a way to hide those fields for a particular group and to link the created field "company_name" as the main link to the profile view?

Would be grateful for help!
Accepted Answer
admin Accepted Answer
Admin
Hi,
sorry for late reply, it is a weekend for us.

In case of companies I need to hide first- and lastname fields (both required) on the profile list and the profile view.
This is not possible, fields like firstname are core fields directly connected to Joomla Name. You can do something like this:
1) User these fields for a reference person of Company
2) Set in Easy Profile options "format name" parameter to "only name", with this option the lastname will be disabled and you can use name field for Company name or User name.

I do not want companies to be listed by first and last name of a person who will be registering particular company.

Is there a way to hide those fields for a particular group and to link the created field "company_name" as the main link to the profile view?
You can create a override of our profile page to show title from another field, see this example:

I have a select field called "registration_type" with these options:
0|User
1|Company
If you choose Company you will have a field called company_name.

Now I can override profile page template and show comany_name instead firstname and lastname if registration_type is "1"
- Copy file from /components/com_jsn/views/profile/tmpl/default.php to /templates/your-template-folder/html/com_jsn/profile/default.php
- Edit new field and replace at line 66 with this:
<?php 
if( $this->data->registration_type == 1 ) echo $this->data->company_name;
else JsnHelper::getFormatName($this->data);
?>


Why override? because with override when you update Easy Profile then this code will not be overwritten. This is a Joomla feature.

NOTE: this code is for example purpose, not tested and not supported.
  1. more than a month ago
  2. General
  3. # Permalink


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.