More in this section

Forums / Developing with Sitefinity / Custom module not shown in main menu

Custom module not shown in main menu

9 posts, 0 answered
  1. Rakesh
    Rakesh avatar
    72 posts
    Registered:
    11 Jan 2011
    30 Jun 2011
    Link to this post
    hai,

    I have created a Product module in my sitefinity4.1 project using the SDK sample.When I run the project an entry is created in the SystemConfig.config as

     <add title="Products" type="ProductsModule.ProductsModule" startupType="OnApplicationStart" name="Products" />
    but the module is not shown in the horizontal main menu.Their for I can't see the module and cannot navigate to it.How can I achieve this.I had came across many posts but no use.

    Please help me....
  2. Anton Mernov
    Anton Mernov avatar
    110 posts
    Registered:
    03 Dec 2008
    30 Jun 2011
    Link to this post
    Hi Rakesh,

    Take a look at this post. It should help you

    Regards,
    Anton
  3. Rakesh
    Rakesh avatar
    72 posts
    Registered:
    11 Jan 2011
    30 Jun 2011
    Link to this post
    Thanks Anton.

    When I done that I got an error.

    "

    No metadata has been registered for class ProductCatalogSample.Model.ProductItem. (This usually indicates, that either this class is not declared persistent or it is declared persistent but not enhanced. The class was loaded from file:///G:/Roopesh/Rakesh/SF/NewSF/TestingLab1/bin/ProductCatalogSample.DLL.)  "


    What I have done is
    > Created a solution ProductCatalogSample
    > Build it and reference of this is added to my Sitefinity project SFTest.
    > When I am running getting this error.

    Could you pls help me...
  4. Anton Mernov
    Anton Mernov avatar
    110 posts
    Registered:
    03 Dec 2008
    30 Jun 2011
    Link to this post
    Rakesh,

    This error indicates that your custom module has persistent class that was not enhanced with OpenAccess enhancer.
    Please check this forum post. There are some changes that have to be done in your *.csproj file to include OA enhancer.

    Also, make sure that the OpenAccessPath is specified correctly and you are using an appropriate SDK version, i.e if you are using Sitefinity 4.1 SP2 the SDK version must be Sitefinity SDK 4.1 SP2

    I hope this helps,
    Anton
  5. Rakesh
    Rakesh avatar
    72 posts
    Registered:
    11 Jan 2011
    30 Jun 2011
    Link to this post
    Hai Anton,
    Thanks for your reply.
    Now their is no error and I added the ResourcesId but the same situation.What else I have to do?
    Shall I give you My Project ?
    Please help me I am in deep trouble.....
  6. Anton Mernov
    Anton Mernov avatar
    110 posts
    Registered:
    03 Dec 2008
    30 Jun 2011
    Link to this post
    Rakesh,

    Could you please share the configuration of this module from SystemConfig.config (screenshot or text)?
    Also, it would be great to see top lines (with namespace and class definition) of your *module*.cs and *resource*.cs files.

    Regards,
    Anton
  7. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    18 Sep 2017
    04 Jul 2011
    Link to this post
    Hi Anton,

    I would guide you trough the steps that should get your products module up and running in no time.
     You should have the SDK for that version of Sitefinity too installed with Telerik RadControls and OpenAccess. too. This is important as their assemblies are referenced in the products module.

    1.Create your project in the Project manager. make sure you log in backend of the site( the requirement to have a functioning project).

    2. Edit your Sitefinity project in Visual Studio.

    3.Right click on the solution and add existing project. Navigate to the SDK and select the products module csproject file.

    4. Right click on the name of the product module project ( ProductsCatalogSample ) and Build ( it is very important to never click Rebuild as it will remove some references).

    5. If you experience build error you should expand References and check the version of the assemblies. They must be the same version as the same assemblies used in your SitefinityWebApp! You can check the version in the properties panel.

    6.Now you should reference the ProductsCatalogSample.dll in SitefinityWebApp. And build the whole solution ( don`t rebuild if you do the references to Facebook.dll and NewtownsoftJson.dll will be removed and you got to reference them again )

    7. To register the module go to App_Data/Sitefinity/Configuration/System.config and enter this line:

    <add title="Products" description="Products" resourceClassId="ProductsResources" type="ProductCatalogSample.ProductsModule" startupType="OnApplicationStart" name="ProductsModule" />
    8. Restart the web.config by making a simple change in it and save.
    9. Browse your site. The module will be installed if in the system.config you changed appears a version.(version="1.0.4191.24347") the version number is auto generated.
    Not always but sometimes your module will not be enhanced. To enhance it review the .csproj file of the module. It should look like this.
    <UserProperties OpenAccess_ConfigFile="App.config" OpenAccess_ConnectionId="DatabaseConnection1" OpenAccess_Enhancing="True" OpenAccess_UpdateDatabase="False" OpenAccess_EnhancementOutputLevel="1" />
        </VisualStudio>
      </ProjectExtensions>
      <PropertyGroup>
        <PostBuildEvent>
        </PostBuildEvent>
        <PreBuildEvent>
        </PreBuildEvent>
      </PropertyGroup>
      <PropertyGroup>
        <OpenAccessPath>$(SolutionDir)..\..\..\..\..\Common\Dependencies\</OpenAccessPath>
      </PropertyGroup>
      <Import Condition="Exists('$(OpenAccessPath)\OpenAccess.targets')" Project="$(OpenAccessPath)\OpenAccess.targets" />
    </Project>

    This should get your module up and running. There is one more problem you may stumble upon. When you do all of the above when viewing the website you will get a loop of System is restarting. To overcome the problem remove the module registration from System.config and Security.config view your site ( it should run without problems) and then register the module again only in the System.config.

    Regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Rakesh
    Rakesh avatar
    72 posts
    Registered:
    11 Jan 2011
    05 Jul 2011
    Link to this post
    Hi Stanislav Velikov,
    I am sorry for the delay in my reply, as I have to complete another work with priority.
    I follwed  your steps above and I got " System is restarting. ".I removed entries from the config files.But still it remains the same.The screen shots are attached.Could you pls help me...
  9. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    18 Sep 2017
    06 Jul 2011
    Link to this post
    Hi Rakesh,

    Then have you added the control registration again after you removed them? The system is restarting should expire in some time. I have added the part with System is Restarting solution because it is not a problem related to the module, but with the restart of Sitefinity. Wait some time and try to browse the Sitefinity backend again. Alternatively you can restart web.config by making a dummy change in it ( like pressing space and saving ).
    You have the module installed successfully when you enter the backend you will see it.

    Kind regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
9 posts, 0 answered