Developer forum

Forum » Development » GroupTemplateExtender - type or namespace name GroupTemplateExtender could not be found

GroupTemplateExtender - type or namespace name GroupTemplateExtender could not be found

Kim Søjborg Pedersen
Reply
I am trying to make a GroupTemplateExtender, but getting the "name GroupTemplateExtender could not be found" what do I miss?

I found the code sample in another post http://developer.dynamicweb-cms.com/forum/development/manipulate-grouplist-before-render.aspx 
using Dynamicweb;
using Dynamicweb.eCommerce.Products;
namespace CustomModules1
{
    public class GroupTemplateExtender1 : GroupTemplateExtender
    {
        public override void ExtendTemplate(Dynamicweb.Templatev2.Template template)
        {
            string userID = User.UserID.ToString();
            string groupID = Group.ID;           
            string requiredUserGroup = "291";//example user group
            //make permission check
            //User.Groups contains array of groups where the user presents
            bool condition = User.Groups.Contains(requiredUserGroup);
            if (condition)
            {
                template.SetTag("Custom.CheckHasAccess", "true");
}
            else
            {
                //nothing to do.
            }
        }
    }
}

Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer
I could be wrong, but I don't think this extender exists in the current version of Dynamicweb. It's there in DW 8, so I guess this is an upcoming feature.

Cheers,

Imar

Votes for this answer: 0
 
Kim Søjborg Pedersen
Reply
Okay thank you Imar, can anybody confirm that this is an upcomming feature?
 
Nicolai Høeg Pedersen
Reply
Yes it is in Dynamicweb 8, item TFS5978.

 

You must be logged in to post in the forum