Creating a relation between Document and Member Group.
I am creating department pages that display a list of members in that department. My members are grouped into department Member Groups and I would like to relate these Member Groups to a respective department page with details of each department.
There is an option in Umbraco (version 7.1.6) to relate Member Groups, however I am not quite sure what to pass to the relate method in the RelationService API.
I can only seem to find a way to retrieve a list of all roles/member groups rather that a specific member group by its name. Once I've retrieved the individual role/member group using a foreach, the Relate method does not accept it as a simple string. Is there a way of retrieving a Member Group object that I am missing?
var relationService = Services.RelationService;
var contentService = Services.ContentService;
var rolesList = memberService.GetAllRoles();
var busDoc = contentService.GetById(1234);
foreach(var role in rolesList)
{
switch (role)
{
case "Business Development":
relationService.Relate(role, busDoc, "departments");
break;
etc...
}
}
Creating a relation between Document and Member Group.
I am creating department pages that display a list of members in that department. My members are grouped into department Member Groups and I would like to relate these Member Groups to a respective department page with details of each department.
There is an option in Umbraco (version 7.1.6) to relate Member Groups, however I am not quite sure what to pass to the relate method in the
RelationService
API.I can only seem to find a way to retrieve a list of all roles/member groups rather that a specific member group by its name. Once I've retrieved the individual role/member group using a
foreach
, theRelate
method does not accept it as a simple string. Is there a way of retrieving a Member Group object that I am missing?Thanks in advance for any help, Aaron
is working on a reply...