More in this section

Forums / Developing with Sitefinity / Creating different Provider for Generic Content module

Creating different Provider for Generic Content module

2 posts, 0 answered
  1. Priti
    Priti avatar
    17 posts
    Registered:
    20 Nov 2008
    15 Jan 2009
    Link to this post
    Hello,

    I was referring section named "Adding Providers" of User Manual at page 209. This section talks about adding new provider to Generic content based News module. Can we also add the new provider for Generic Content module the same way as it is done for news module?
    I tried doing this but could not because I could not perform steps 7 and 8 of this walkthrough because there is no such section for Generic Content module in web.config.
    Is there any way by which I can add different provider to Generic Content module? I want to do it so that I can represent different entities in my site as generic content with different providers.
    e.g. - Book will have metafields for storing book information and
    Author will have metafields for storing author's information.

    Thanks,
    Priti.
  2. Nikolai
    Nikolai avatar
    216 posts
    Registered:
    01 Jun 2017
    15 Jan 2009
    Link to this post
    Hello Priti,

    Please follow these steps to add a generic content provider:
    1. Open the web.config file.
    2. Go to the Providers section and add your custom provider:
     <cmsEngine defaultProvider="Generic_Content"
          <providers> 
            <clear /> 
           
            <add name="YourCustomProviderName" applicationName="/YourCustomProviderName" urlRewriteFormat="[Publication_Date]/[Name].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="True" defaultMetaField="Name" securityProviderName="" allowLocalization="True" allowVersioning="True" allowWorkflow="False" allowComments="false" commentsModeration="true" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data" /> 

    3. In the MetaFields section, add your provider specific meta fields:
     <metaFields>        
            <add key="YourCustomProviderName.Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="Name this content" mandatory="True" /> 
            <add key="YourCustomProviderName.Description" valueType="LongText" visible="True" searchable="False" sortable="True" defaultValue="Add description here" /> 
            <add key="YourCustomProviderName.Author" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
            <add key="YourCustomProviderName.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
     

    4. Copy the control templates of Generic Content directories to ~\Sitefinity\Admin\ControlTemplates\YourCustomProviderName\. Please have in mind that the meta fields in the web.config file must correspond directly to the those set in the templates. If you use the same Meta fields as the ones defined for  your default Generic Content provider, you can Copy/Paste the templates without any changes.

    5. You should do the same with the public controls.

    Hope this Helps.


    All the best,
    Nikolai
    the Telerik team

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