<?php
$user = JFactory::getUser();
$groups = $user->get('groups');
foreach($groups as $group) {echo 'group'.$group.' ';}?>
Dev & Tech Notes
San Diego | Los Angeles | Big Bear | USA
Terms & Conditions ©2005-2024 TJohns.co
Terms & Conditions ©2005-2024 TJohns.co
Articles in this Category
- Add Dropdown Category List to Joomla
- Booking & Reservation Extensions
- Echo Usergroup - Specific Class for Different Usergroups
- Getting the Intro & Full Text Images for Custom Article Template
- How to Get User Name - Joomla 3
- How to Use Shortcodes in Joomla Template Files via PHP
- Insert Code for Specific Component
- Inserting, Updating, & Deleting Data via JDatabase
- Joining Across Multiple Tables Example
- Joomla Custom Fields Don't Work
- Joomla Extension Directory - Fake Reviews
- Joomla Extension Directory = GARBAGE
- Layout Overrides (alternative layout)
- No Input Field for Tags on Front End 'Create Article'
- Reading & Writing to the Joomla Database
- Redirect Joomla Home Page for Different User Groups
- Remove Joomla Tooltips
- test notification
- Unique Body Class in Joomla 3
Top Left Text cha
Web & App Development
Echo Usergroup - Specific Class for Different Usergroups
- Details
- Written by Timothy Johns
- Category: Joomla
- Hits: 1710
This is useful if you want to add a class to change things on the page depending on the usergroup. Just insert the PHP below wherever you want to echo the usergroup...
Comments