This can be accomplished by using the velocity method $theme_display.getScopeGroup() in the theme. This method can be assigned to an velocity variable either in the init_custom.vm or portal_normal.vm based upon the developer’s convenience.
#set ($thisScopeGroup = $theme_display.getScopeGroup())
$thisScopeGroup
This would provide all the group details as below:
{groupId=27518, companyId=10201, creatorUserId=15402, classNameId=10021, classPK=27518, parentGroupId=0, liveGroupId=0, name=Another Group, description=Just another group or community, type=2, typeSettings=, friendlyURL=/new-group, active=true}
To get an individual detail such as groupId, we could simply use $thisScopeGroup.getGroupId() ($thisScopeGroup is defined above) and assign it to a velocity variable as:
#set ($scopeGroupId = $thisScopeGroup.getGroupId())
This would output only the group Id and can be used for further manipulations.
