Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

How to call group id?

9 years 8 months ago
  • Tim's Avatar
    Topic Author
  • Tim
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 0
Licenses:
JomSocial Expired

Hi. I'm trying to reference the currently displayed group id in a module that's displayed on the /viewgroup page. I've been trying this code but it doesn't seem to work:

$group = JTable::getInstance('Group', 'CTable');
$group->load($groupId);
then I set a variable = $group->id;

This code doesn't seem to pull the group's id though. I looked through the documentation and found info on how to call the object for a user, but not a group. Can you provide some guidance on which php code should be used to reference the group id.....I really don't want to parse my URL :)

Thanks,

Tim

9 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi Tim,

Where did you call it? if you called the group id on group detail page you should use this code first :

$groupId = JRequest::getInt('groupid', '');

thank you!

9 years 8 months ago
  • Tim's Avatar
    Topic Author
  • Tim
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 0
Licenses:
JomSocial Expired

Thank you, this code works! Yes it was from the group detail page.

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW