By Haki Saki on Thursday, 05 November 2015
Posted in General
Replies 7
Likes 0
Views 768
Votes 0
I use the MetaMod extension with my site to show certain modules when certain conditions are met with other components. I'm trying to use it now with ES (specifically when a certain Group is opened). I see the group ID value is passed but I am trying to see if the Group Category has some type of ID that I can check against...so if any Group in Category X is displayed then show Module Y..Make sense? This is what I have so far for parameters being passed when a Group is shown:

MetaMod debug info:
Module ID: 994
$option: com_easysocial
$view: groups
$id: 88-lake-powell-paddleboards
$Itemid: 972
$timezone: UTC
$language: en-us
$language_code: en
$language_region: us
Including modules: None

Thoughts on how to accomplish this?
Hello Haki,

I'm not sure what you are trying to achieve here but here is how to get the Group Category. To get the Group category ID, you have to load the Group library and get it from there:


$group = FD::group($id); // Load the group library.
$categoryID = $group->getCategory()->get( 'id' ); // Get the Category ID for that group.


Hope this helps.
·
Friday, 06 November 2015 11:31
·
0 Likes
·
0 Votes
·
0 Comments
·
I have about 20 different Group Categories, so when someone opens a Group, I want to check what Category that Group is in and display a specific Module..I will play around with that and see what happens.
·
Friday, 06 November 2015 11:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Haki,

Sure, let us know how it goes.
·
Friday, 06 November 2015 12:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Along the same lines as the above question..how would I determine a user's profile ID? I want to show a particular module when a particular users profile is viewed. thoughts?
·
Wednesday, 01 June 2016 09:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Haki,

Did you mean you want to get the ID of the viewed profile? If so, you can just use this:

$userId = JRequest::getVar('id');


Hope this helps.
·
Wednesday, 01 June 2016 10:07
·
0 Likes
·
0 Votes
·
0 Comments
·
when a user clicks on another's profile (the ID of the user profile selected)..so not the user logged in but the user selected..make sense?
·
Wednesday, 01 June 2016 10:13
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Haki,

Yes, you can use the code provided in my previous reply.
·
Wednesday, 01 June 2016 10:16
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post