Dynamicweb.Modules.UserManagement Namespace : GroupTemplateExtender Class |
'Declaration
Public MustInherit Class GroupTemplateExtender Inherits Dynamicweb.Extensibility.TemplateExtender
public abstract class GroupTemplateExtender : Dynamicweb.Extensibility.TemplateExtender
using System; using System.Linq; using Dynamicweb; using Dynamicweb.Modules; using Dynamicweb.Modules.UserManagement; Namespace CustomModules1 { public class GroupTemplateExtender1 : GroupTemplateExtender { public override void ExtendTemplate(Dynamicweb.Rendering.Template template) { template.SetTag("MyCustomGroupTag", "MyCustomGroupValue:" + Group.Name); if (IncludeGroupsAndUsers) { GroupCollection subgroups = new GroupCollection(); subgroups.AddRange(Group.Subgroups); //Do some actions with subgroups. UserCollection users = new UserCollection(); users.AddRange(Group.Users.Where( u => u.Active && u.ValidFrom <= DateTime.Now && u.ValidTo >= DateTime.Now)); //Do some actions with users. if(Group.Parent != null) { //Do some actions with parent. } } } } }
System.Object
Dynamicweb.Extensibility.TemplateExtender
Dynamicweb.Modules.UserManagement.GroupTemplateExtender
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2