Dynamicweb 8 Documentation
GroupTemplateExtender Class
Members  Example 

Represents template extender.
Object Model
GroupTemplateExtender ClassGroup Class
Syntax
'Declaration
 
Public MustInherit Class GroupTemplateExtender 
   Inherits Dynamicweb.Extensibility.TemplateExtender
public abstract class GroupTemplateExtender : Dynamicweb.Extensibility.TemplateExtender 
Example
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.
               }
           }
       }
   }
}
Inheritance Hierarchy

System.Object
   Dynamicweb.Extensibility.TemplateExtender
      Dynamicweb.Modules.UserManagement.GroupTemplateExtender

Requirements

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

See Also

Reference

GroupTemplateExtender Members
Dynamicweb.Modules.UserManagement Namespace

Send Feedback