Try our conversational search powered by Generative AI!

Programmatically Add Gadget for User



Is there a way to programmatically add a Gadget (and/or Tab) to a user's Dashboard? I'd like all users to have a custom Gadget pre-added when they log in.


Exactly the same post was asked and anwsered concerning CMS 6. But the same answer doesn't apply to CMS 7 :(


Mar 22, 2014 22:29

If the gadget/component is part of your code base, you can just add the dashboard default tab to the PlugInAreas property:

    public class YouTubeComponent : ComponentDefinitionBase
        public YouTubeComponent()
            : base("epi-cms.widget.HierarchicalList")
            Categories = new string[] { "content" };
            Title = "YouTube";
            Description = "List content from YouTube";
            SortOrder = 900;
            PlugInAreas = new[] { PlugInArea.DashboardDefaultTab };
            Settings.Add(new Setting("repositoryKey", YouTubeRepositoryDescriptor.RepositoryKey));


Edited, Mar 24, 2014 9:52

Thank you Linus!

Could I add the Gadget/Component only for users with a certain role? We only wish to add the gadget for users who need it due to their roles.

Mar 24, 2014 11:50


Right now, the way this can be achieved is by defining a list of roles in the AllowedRoles property. This has the potentially negative side effect that users that are not part of these roles will not even be able to add this gadget manually. I will see if I can contribute a fix to make it possible to separate who should get the gadget automatically with access to it.

Mar 27, 2014 12:41

That's good to know. Thanks again :)

Mar 30, 2014 17:25

We actually need to create custom dashboard tabs for the user too, and add the gadgets programmatically for individual users.

Could you please help me with what Episerver API classes are used to manage dashboard tabs and gadgets?

May 22, 2014 11:45


I've finally had the time to sit down and write some code to accomplish this. Not sure if you still need it but if you do, please have a look at the following repository:

Nov 11, 2014 12:27

Thank you, Linus! This will be useful for future use, and hopefully for others too.

Nov 19, 2014 16:07
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.