More in this section

Forums / General Discussions / Custom Configuration Items in Module

Custom Configuration Items in Module

5 posts, 1 answered
  1. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    11 May 2011
    Link to this post
    Hi All,

    I am at the end of a SF4 development but due to some last minute changes i need to update my custom modules configuration to include a couple of extra strings but i cant seem figure out how?

    I simply want to add a couple of string config items to this configuration below, can anyone point me in the right direction?

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Telerik.Sitefinity.Modules.GenericContent.Configuration;
    using Telerik.Sitefinity.Configuration;
    using BlocksModule.Data;
     
    namespace BlocksModule.Config
    {
        public class BlocksConfig : ContentModuleConfigBase
        {
     
            public override string DefaultProvider
            {
                get
                {
                    return "Linq2SqlDataProvider";
                }
            }
     
            protected override void InitializeDefaultProviders(Telerik.Sitefinity.Configuration.ConfigElementDictionary<string, Telerik.Sitefinity.Configuration.DataProviderSettings> providers)
            {
                providers.Add(new DataProviderSettings(this.Providers)
                {
                    Name = "Linq2SqlDataProvider",
                    Description = "A provider that stores blocks data in a database using Linq2Sql.",
                    ProviderType = typeof(Linq2SqlDataProvider)
                });
            }
     
            protected override void InitializeDefaultViews(Telerik.Sitefinity.Configuration.ConfigElementDictionary<string, Telerik.Sitefinity.Web.UI.ContentUI.Config.ContentViewControlElement> contentViewControls)
            {
            }
        }
    }
  2. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    12 May 2011
    Link to this post
    Can anyone help me with this, i am very stuck :(

    Rob
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    12 May 2011
    Link to this post
    Hello Roberto,

    There is a help section that explains how to work with configurations and how to create custom configuration. Does the articles help?

    Greetings,
    Ivan Dimitrov
    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
    Answered
  4. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    12 May 2011
    Link to this post
    Hi Ivan,

    I did find that but coudnt figure out how it was related, i will take another loo. I dont want to create a new configuration section, i have one, it already exists in my module, but past the basic provider setting that is in there i dont know how i can add to it (i want to add a url key etc), if you look at my code that is the config code of my module, can i use code that is in the config section documentation you linked to in that? if so, is there any chance you could provide a simple example that is related to my code?

    Thanks,

    Rob
  5. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    13 May 2011
    Link to this post
    Thanks Ivan,

    Woke up this morning took another look at the docs and found that was exactly what i needed.  Updated this thread to accept your response as the answer.

    Thanks again,

    Rob
5 posts, 1 answered