You wrote:
I want a special view for a specific usergroup of users
but i need:
I want a special view with a specific usergroup of users
My fault, yes my code do this...$this->user contain the displayed user object, so $this->user->getAuthorisedGroups() return the array of usergroups IDs of the displayed user
The views should be public. That means, i have a list with all members (including the specialists). When i klick on a user, the "normal" Profile appears.
mmmh...if this is your need then my solution does not works...my solution allow you to show different informations based on user's group
To make this there are 2 solutions:
1) Use modules and content plugin:
- Create 2 different menu items of type Easy Profile->User Profile (profile and specialist-profile) and set each list to open different profile menu items (set All users list to use "profile" menu item and specialist users list to open "specialist-profile" menu item)
- Go to Extensions->Modules
- Create a module of type "Custom" and set it like this:
Title: Extended informations for specialist
Position: Some position in your template
Menu Assignment: set the "specialist-profile" menu item
In the editor put a code like this: This is a specialist and he is called {user avatar displayed}, I'm a specialist of {user specialization displayed}
strings like {user avatar displayed} and {user specialization displayed} will be replaced with the displayed user, docs with example at
http://docs.easy-profile.com/index.php/article/content-plugin
2) - Create 2 different menu items of type Easy Profile->User Profile (profile and specialist-profile) and set each list to open different profile menu items (set All users list to use "profile" menu item and specialist users list to open "specialist-profile" menu item)
- Create an template override: copy file from components/com_jsn/views/profile/default.php to /templates/your-theme-folder/html/com_jsn/profile/default.php
- In the new file you can customize the code by adding something like this
$app = JFactory::getApplication();
$menu = $app->getMenu()->getActive()->id;
if($menu == 756) : /* replace 765 with the id of the specialist-profile menu */?>
OUTPUT FOR SPECIALISTS
<?php else : ?>
OUTPUT FOR OTHER USERS
<?php endif;