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

Forums / General Discussions / Custom Module

Custom Module

54 posts, 0 answered
  1. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    18 Nov 2010
    Link to this post
    I am developing a custom module in sitefinity for my client. Is there any way I can find the aspx code, code behind and any javascript/ jquery files to build/reuse the exact same sub modules "Category, Tags, and Permissions". However, these sub modules are available under News, Events and Wiki modules. I want exact same sub modules with similar functionality and skin to use in my new custom based module. All I want a complete code.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Nov 2010
    Link to this post
    Hello Asif,

    The source code is not distributable. You can use Generic Content based module which will give you Categories, Tags and all other views out of the box. Please take a look at

    Sample Generic Content based module: Products module

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    22 Nov 2010
    Link to this post
    Hi,
    I have used the exact steps you mentioned but I am facing an error
    "

    Could not load file or assembly 'Telerik.Security, Version=3.6.1870.2, Culture=neutral, PublicKeyToken=dfeaee0e3978ac79' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    "
    However, I am using a version 3.7.2136. And if I write this code
    "<dependentAssembly>
                    <assemblyIdentity name="Telerik.Security" publicKeyToken="dfeaee0e3978ac79" culture="neutral" />
                    <bindingRedirect oldVersion="3.6.1870.2" newVersion="3.7.2136.2" />
                </dependentAssembly>"
    into web.config file then I get an error
    "

    Method 'get_Controls' in type 'Telerik.Samples.Products.ProductsModule' from assembly 'Telerik.Samples.Products, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

    "
    Please help.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Nov 2010
    Link to this post
    Hello Asif,

    Please update the references of the class library. More information about adding/removing references can be found at MSDN

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    23 Nov 2010
    Link to this post
    Hi, I have added the references to the "Telerik.Samples.Products" I did right click on it and click on add reference and then i added "Telerik.Cms.Engine, Telerik.Cms.Web.UI, Telerik.Framework and Telerik.Security". But, still I am facing same issues. Please help
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Nov 2010
    Link to this post
    Hello Asif,

    If you get the same error your project still has a reference to the old assemblies version. Please clean the solution and make sure that your references do not update automatically. If the references are correct you should not get such a error.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    23 Nov 2010
    Link to this post
    Finally this product module is integrated with my project. Few Questions.
    1. How to use external template for it? If I need to add some functionality in it? Add, Edit or some other functionalities I have done something for existing module (Event). But I am not sure how to do it for custom based module
    <!--Inserts an event item-->
          <viewSettings hostType="Telerik.Events.WebControls.Admin.EventsItemNew" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Events/EventsItemNew.ascx" />
          <!--Edits an event item-->
          <viewSettings hostType="Telerik.Events.WebControls.Admin.EventsItemEdit" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Events/EventsItemEdit.ascx" />

    2. The new custom module "Product" is showing as a first tab in Admin Area. Is it possible to show it in the last tab?
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Nov 2010
    Link to this post
    Hi Asif,

    1.  Products module works with embedded templates, so the mapping is the same as for each other GenricContent module, only the hostType is different. For instance the host type for ProductsEditView is

    Telerik.Samples.Products.WebControls.Admin.Products.ProductEditView

    2. Add the Products module right before the closing tag of <framework><modules> section. The tabs are bound up down.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    24 Nov 2010
    Link to this post
    Hi,
    I want to change the name of custom module "Products" to "something"? Please help me how to do that?
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Nov 2010
    Link to this post
    Hello Asif,

    Open Telerik.Samples.Products.Resources.Messages.resx and you can edit the value of Module_Name and Module_Titile keys

    Module_Name   Products
    Module_Title   Products

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  11. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    24 Nov 2010
    Link to this post
    Hi,
    I want to change the value "/products" to "/XYZ" from "Application" column in both tables sf_CmsCategory and sf_CmsTags. How to do that? and also Do I need to change the relationship in "Adding a XYZ" functionality. If I create a new XYZ and if let's say I change the value in column Application to "/XYZ" So how this functionality will grab record where Applications is "/XYZ"?
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Nov 2010
    Link to this post
    Hi Asif,

    You can execute a simple UPDATE Query against the database tables, but you have to change the application only if you have another provider with the name XYZ, otherwise you will not see this data anymore. Sitefinity relies on the provider model.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  13. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    24 Nov 2010
    Link to this post
    Hi,
    I want If I add any category using Add Category User Interface under Custom Module "XYZ" then the record should insert into the table sf_CmsCategory and the Applications column should be "/XYZ" instead of "/Products". Maybe I need to change something in the existing Stored Procedure? and I want same for sf_CmsTag and same for Permissions.
  14. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Nov 2010
    Link to this post
    Hi Asif,

    Do you have a different provider and why don't you create it and use it instead of making direct queries to the database?

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  15. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    24 Nov 2010
    Link to this post
    Hi,
    What is name of table for permission? for example sf_CmsCategory is for Categories? But what the table is for Permission?
  16. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Nov 2010
    Link to this post
    Hello Asif,

    The table is [sf_SecPerms]

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  17. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    24 Nov 2010
    Link to this post
    When I add change permission in Events then it stores the record in table but the Application column is "/" and when I add permission in my new custom module "XYZ" it saves same record in table with column Application "/". However, the ObjectId is different which should be different in order to make them unique. My question is how to find out if the permission I changed will only be implement in my specific module? It seems to be same values in permission table.
  18. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Nov 2010
    Link to this post
    Hi Asif,

    You can take a look at Security TOC. which explains how the permissions work. If you have separate provider is name is used as an identified. Also the module generates SecurityRootID - guid used when GlobalPermissions class is initialized. The class represents the specified secured object that will be protected.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  19. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    25 Nov 2010
    Link to this post
    Can you help me to solve this error? When I try to change "products" to "FAQs" in web.config file then it happens however I have changed "/Products" to "/FAQs" in this line "[WebSysTemplate(ProductsPermissionsView.layoutTemplateName, "ProductsPermissionsView_Template_Desc", "/FAQs", false, "2009-04-10")]" in all pages under Admin/Products and "ProductsPermissionsView.cs" in Admin folder Also I have changed this line "(SectionHandler)ConfigurationManager.GetSection("telerik/FAQs");" in ConfigHelper.cs

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Unrecognized configuration section telerik/products.

    Source Error:

    Line 569:        </cmsEngine>
    Line 570:        <!-- Added for Custom Modules FAQ -->
    Line 571:        <products defaultGenericProvider="FAQs">
    
  20. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    25 Nov 2010
    Link to this post
    One more thing. I have changed the Project name "Telerik.Samples.Products" to "Telerik.XYZ.Module". I can use the Categories, Tags and Permission in this custom module after renaming it but when I click on the main page then it throws an error.

    Invalid resource name (Telerik.Samples.Products.Resources.ControlTemplates.Backend.ProductItemsList.ascx) for assembly (Telerik.XYZ.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) or empty template.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: Invalid resource name (Telerik.Samples.Products.Resources.ControlTemplates.Backend.ProductItemsList.ascx) for assembly (Telerik.XYZ.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) or empty template.


    Please help.
  21. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    25 Nov 2010
    Link to this post
    Hello Asif,

    1. You need to change the path to the embedded template - Telerik.Samples.Products.Resources.ControlTemplates.Backend.ProductItemsList.ascx. Currently the ProductItemsList.cs is trying to load the file from Telerik.Samples.Products instead of Telerik.XYZ.Module.

    2. The Unrecognized configuration section

    • Register the products configuration section by pasting the following line in the web.config file as an immediate child of <sectionGroup name=”telerik”>:
      <section name="products" type="Telerik.Samples.Products.Configuration.SectionHandler, Telerik.Samples.Products" requirePermission="false" />
    • Register Products module by pasting following line as an immediate child of telerik/framework/modules section:
      <add type="Telerik.Samples.Products.ProductsModule, Telerik.Samples.Products" /> 
    • Add new Generic Content provider by pasting following line as an immediate child of the telerik/cmsEngine/providers section:
      <add name="Products" urlRewriteFormat="[Name].aspx" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" securityProviderName="" allowVersioning="True" applicationName="/Products" versioningProviderName="" allowComments="false" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data"></add> 
    Make sure that you have Configuration folder with all classes from the demo in your class library.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  22. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    25 Nov 2010
    Link to this post
    Hi,
    I can't find ProductItemsList.cs. However I can find ProductItemsList.ascx file under Resources/ControlTemplates/Backend folder But can't find its code behind file. How to get this file. Although I have change "Telerik.Samples.Products" to "Telerik.XYZ.Module" every where and I cant find this name in entire project. It was working fine when I integrated it with my project but when I changed the name to "Telerik.XYZ.Module" then it is throwing the exception
    "

    Invalid resource name (Telerik.Samples.Products.Resources.ControlTemplates.Backend.ProductItemsList.ascx) for assembly (Telerik.XYZ.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) or empty template.

    "
    Please help
  23. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    25 Nov 2010
    Link to this post
    Hi Asif,

    You have changed the class library name which means that the reference toTelerik.Samples.Products.Resources is not valid. You have to update all references to Telerik.Samples.Products with the new value you use.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  24. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    26 Nov 2010
    Link to this post
    Can you help me to solve this error? When I try to change "products" to "FAQs" in web.config file then it happens however I have changed "/Products" to "/FAQs" in this line "[WebSysTemplate(ProductsPermissionsView.layoutTemplateName, "ProductsPermissionsView_Template_Desc", "/FAQs", false, "2009-04-10")]" in all pages under Admin/Products and "ProductsPermissionsView.cs" in Admin folder Also I have changed this line "(SectionHandler)ConfigurationManager.GetSection("telerik/FAQs");" in ConfigHelper.cs

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Unrecognized configuration section telerik/products.

    Source Error:

    Line 569:        </cmsEngine>
    Line 570:        <!-- Added for Custom Modules FAQ -->
    Line 571:        <products defaultGenericProvider="FAQs">
    
  25. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Nov 2010
    Link to this post
    Hi Asif,

    You have not registered the module correctly. The sample module contains a web.config file which you can merge with your project config.

    You have changed the configuration file to use telerik/FAQs, but you have added telerik/products in the web.config.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  26. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    26 Nov 2010
    Link to this post
    If I want to make change on my project's web.config file to change "products" name as "FAQs". So I think I need to change following entries?

    -- My Project's Web.Config --

    <section name="FAQs" type="Telerik.XYZ.Module.Configuration.SectionHandler, Telerik.XYZ.Module" requirePermission="false" />

    <add name="FAQs" urlRewriteFormat="[Name].aspx" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" securityProviderName="" allowVersioning="True" applicationName="/FAQs" versioningProviderName="" allowComments="false" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data"></add>

    <add key="FAQs.Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="Name this content" mandatory="True" />
            <add key="FAQs.Price" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
            <add key="FAQs.SKU" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
            <add key="FAQs.Weight" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
            <add key="FAQs.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />

    <products defaultGenericProvider="FAQs">
          <genericContentProviders>
            <add providerName="FAQs" urlRewriteFormat="[Name].aspx" urlWhitespaceChar="_" />
          </genericContentProviders>
        </products>

    Sample.Products Files..

    What needs to be changed in this project? only "telerik/products" to "telerik/FAQs" in ConfidHelper.cs?

    Currently there is only 1 web.config file which I am using in my projects
  27. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Nov 2010
    Link to this post
    Hello Asif,

    The name of the section should be the value you have defined in ConfigHelper.cs.

    <section name="telerik/FAQs".....


    the provider should be chaged to

    <FAQs defaultGenericProvider="FAQs">
          <genericContentProviders>
            <add providerName="FAQs" urlRewriteFormat="[Name].aspx" urlWhitespaceChar="_" />
          </genericContentProviders>
        </FAQs>


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  28. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    26 Nov 2010
    Link to this post
    Hi,
    Thanks for the help this module is working totally fine.
    One more thing. If I want to add an additional control with the custom module what should I do to add it? for example. I have following controls in my custom module

    Products
    Categories
    Tags
    Permission

    I want to add "XYZ" and I already have created a control for it but not sure how to connect it with custom module.
    Please help 
  29. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Nov 2010
    Link to this post
    Hi Asif,

    Inside ProductsModule class there is a property Controls which returns generic list of IToolboxItem. This is the place where you can register your custom control

    sample

    public override IList<IToolboxItem> Controls
            {
                get
                {
                    return new List<IToolboxItem>(new ToolboxItem[]
                                {
                                    new MyControl1(),
                                    new MyControl2()
                                });
                }
            }


    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  30. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    29 Nov 2010
    Link to this post
    Hi,
    I have created a new user and assigned a new role which is "xyz" after logged in with new user when I click on my custom module I get following exception.

    A required control was not found in the template for "Telerik.XYZ.Module.Resources.ControlTemplates.Backend.ProductItemsList.ascx". The control must be assignable form type "System.Web.UI.WebControls.IButtonControl" and must have ID "groupOperationsLink".

Register for webinar
54 posts, 0 answered
1 2