+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Modules won't show in admin menu

Modules won't show in admin menu

6 posts, 0 answered
  1. Lupi
    Lupi avatar
    38 posts
    Registered:
    17 May 2004
    02 Sep 2010
    Link to this post
    Hello,

    Following the Jobs module example from the SDK I created a Migration module. I followed the steps in the video from this thread - only instead of "Jobs" everywhere I have "Migration". I attach a screenshot of my settings and you can download the Class Library project from here.

    I add a project reference from my main SF 4.0 project to the Migration project. When enter these settings, check the "Install" checkbox, restart the web server and start debugging the site I successfully hit a breakpoint set in the first line of public override void Install(SiteInitializer initializer). I track down the execution of Install and it completes successfully. I'm using the same Guids for landingPage and subPage as in the Jobs example but that's ok, because I don't have this module installed.

    But I still can't make the "Migration" menu item to show under the Content menu. I deleted my Temporary ASP.NET files, cleared the browser cache, restarted the computer twice and still nothing. I noticed that there are no records in sf_page_node and sf_page_data tables with id/content_id of 13FA3CB0-6F00-4DFB-A534-28EA60252A16 and A52C36E1-3D29-4F39-BB8D-BB1F064E556A, which should be the Guids of the backend pages. I don't know if this is important, but I'm using the built-in Cassini webserver.

    Regards,
    Lupi
  2. Joe Keller
    Joe Keller avatar
    48 posts
    Registered:
    07 Apr 2010
    03 Sep 2010
    Link to this post
    Make sure you are checking the "Install" checkbox on the configuration screen. This is not listed in the documentation, but, it does need to be checked.
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    03 Sep 2010
    Link to this post
    Hello,

    Yes, Install should be checked. Make sure that you have build the solution before all changes. Let me know if the problem still exist.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  4. Lupi
    Lupi avatar
    38 posts
    Registered:
    17 May 2004
    03 Sep 2010
    Link to this post
    I did check the Install checkbox, that's why I hit the breakpoint in the void Install() method of my module. The module obviously installs, but won't show in the admin menu. I also cleaned and rebuilt the solution several times.

    Any other cache I'm not aware of that might need cleaning?
  5. Joe Keller
    Joe Keller avatar
    48 posts
    Registered:
    07 Apr 2010
    03 Sep 2010
    Link to this post
    Not sure if it will help, but, you could also read this post, I had lots of problems with the install also:
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    14 Sep 2010
    Link to this post
    Hello,

    Here is a sample code for a module that runs fine at my end. "Install" checkbox should be selected and application restarted. If the module do not appear after the first restart do a second or flush the site map, because we are creating a new node in navigation and the nodes could be still cached.

    class SampleModule : ModuleBase
       {
           public override Guid LandingPageId
           {
               get
               {
                   return SampleModule.landingPageId;                    
               }
           }
     
           public override Type[] Managers
           {
               get
               {
                   return null;
               }
           }
     
           public override void Initialize(ModuleSettings settings)
           {
               base.Initialize(settings);
           }
     
           public override void Install(Telerik.Sitefinity.Abstractions.SiteInitializer initializer)
           {
               base.Install(initializer);
     
               var _SiteInitializerNode = initializer.PageManager.GetPageNode(SiteInitializer.ModulesNodeId);
               var _pageManager = initializer.PageManager;
     
     
               var sNode = _pageManager.GetPageNodes().Where(p => p.Id == nodeId).SingleOrDefault();
               if (sNode == null)
               {
                   sNode = initializer.CreatePageNode(nodeId, _SiteInitializerNode);
     
                   sNode.Name = "IvanModule";
                   sNode.ShowInNavigation = true;
                   sNode.Attributes["ModuleName"] = "IvanModule";
                   sNode.Title = "IvanModule";
                   sNode.UrlName = "IvanModule";
               }
     
               var id = landingPageId;
               var landingPage =
                   _pageManager.GetPageNodes()
                   .SingleOrDefault(p => p.Id == landingPageId);
               if (landingPage == null)
               {
                   var pageInfo = new PageElement()
                   {
                       PageId = landingPageId,
                       Name = "IvanModuleName",
                       MenuName = "IvanModuleMenuName",
                       UrlName = "IvanModuleUrl",
                       Description = "IvanModuleDesc",
                       HtmlTitle = "IvanModuleHtmlTitle",
                       IncludeScriptManager = true,
                       ShowInNavigation = false,
                       EnableViewState = false,
                       TemplateName = SiteInitializer.BackendTemplateName
                   };
     
                   var panel = new Literal();
                   initializer.CreatePageFromConfiguration(pageInfo, sNode, panel);
               }
     
           }
           public static readonly Guid landingPageId = new Guid("597E0C2B-F1D3-4386-BB7F-714C640573B3");
           public static readonly Guid nodeId = new Guid("006F8DC0-4576-43AB-BE64-544C21007852");
     
       }



    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
6 posts, 0 answered