Developer forum

Forum » Dynamicweb 10 » Customizing the area list

Customizing the area list

Shiwanka Chathuranga
Shiwanka Chathuranga
Reply

Seems documentation is outdated, did i miss anything?

https://doc.dynamicweb.dev/documentation/extending/administration-ui/arealist.html

public sealed class TestArea : AreaBase
{
    public TestArea()
    {
        Name = "Test";
        Icon = Icon.AirPlay;
        Sort = 30;
        ContextActions.AddRange(GetContextActions());
    }

    private IEnumerable<ActionNode> GetContextActions()
    {
        var permissionSection = GetPermissionSection();

        List<ActionNode> contextActions =
        [
            new()
            {
                Name = "Permissions",
                Icon = Icon.Lock,
                PermissionLevelRequired = PermissionLevel.All,
                NodeAction = NavigateScreenAction.To<PermissionListScreen>()
                    .With(new PermissionsByIdentifierQuery
                    {
                        Name = permissionSection.GetPermissionName(),
                        Key = permissionSection.GetPermissionKey()
                    }),
            }
        ];

        return contextActions.WithPermission(permissionSection.GetPermission());
    }
}


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Shiwanka.

I do not think it is outdated. You might need to restart the application to see the area. 

 
Shiwanka Chathuranga
Shiwanka Chathuranga
Reply

After restart also no output 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

You login as admin?

 
Shiwanka Chathuranga
Shiwanka Chathuranga
Reply

Yes, login as Administrator 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

I can get your code to work just fine:

Try a complete simple version:

public sealed class TestArea : AreaBase
{
    public TestArea()
    {
        Name = "Test";
        Icon = Icon.AirPlay;
        Sort = 30;
    }
}
 
Shiwanka Chathuranga
Shiwanka Chathuranga
Reply

can you check what was missing?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Nothing is missing.

My guess is that you do not get it installed correctly...

In your specific project you seem to have unused references - it could be they cannot load causing the addin to not load at all.

 

You must be logged in to post in the forum