开发者

How to display a custom profile based on a specific role?

开发者 https://www.devze.com 2023-01-10 13:48 出处:网络
For example I have a role called \"teachers\". For any user that belongs to that role, I want to be able to display a custom profil开发者_Go百科e that is different then the main one. I read at some pl

For example I have a role called "teachers". For any user that belongs to that role, I want to be able to display a custom profil开发者_Go百科e that is different then the main one. I read at some place that one can make a tpl file in the pages folder of the theme and some how it could be made to show for specific roles or URL path.

Would anyone care to elaborate and help me out on that?

thanks


I would recommend taking a look at the content profile module: http://drupal.org/project/content_profile. With this module you can specify a content type to be used for user profiles. By doing this you can leverage CCK and do anything with this profile node that you could with any other type of node (list with views, panels, style it with node.tpl.php, etc.).

Also, you can have different roles assigned to different content profiles by setting node permissions appropriately. For example you would want to check "create teacher_profile content" and "edit own teacher_profile content" where "teacher_profile" is the name of the content type you would create. You could then create a second role called "student" and a second content type called "student_profile" and apply similar permissions to allow only students to create and edit their respective profiles of this different content type.


You can use User types, which is described as

This modules gives you the power to make custom profiles for certain types of users. The core profile module must be enabled for this. It let’s you determine for which profiles a field will be active. For example: If we want a field where you can enter who’s your favorite band, you create this field and at the bottom you can choose for which user types (which you defined earlier in admin/user/user_types) this field will be active using the checkboxes. It’s that simple. It's also possible to automatically assign a role per user type.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号