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

Forums / Developing with Sitefinity / Saving custom designer settings for reuse

Saving custom designer settings for reuse

3 posts, 0 answered
  1. Susan
    Susan avatar
    14 posts
    Registered:
    08 Oct 2007
    02 Feb 2012
    Link to this post
    This one might be a little overly complex, but just wanted to throw it out there in the event anyone has tackled this.

    I've built a custom control with a custom designer, settings are picking up perfectly. The control is going to be reused at multiple points on the site, but often with one of the same set of 10 "stock" settings. Is there any way to set the designer up to save these settings as they are created and then allow the user to select from a list either one of the ten, or click a custom button to expose the rest of the designer?

    The only two ways I can think of doing this are:
    1) Create 10 different custom controls to be reused with the settings baked in. They can derive from the existing control so that I still have some re-usability with the design, but the default controls will be locked down. Upside here would be I could change the look/feel in one place and have it update everywhere it's used on the site.
    2) Hard code the default settings into the control designer. This would work fine for the settings I have defined now, but if I want to save something new down the line, I have to code it into the control. Not impossible, but not ideal.

    I guess I'm looking for a "share settings" option for custom controls along the lines of sharing content for use in content blocks. Is this even possible? Any suggestions would be appreciated.
  2. Tim
    Tim avatar
    258 posts
    Registered:
    22 Jun 2011
    02 Feb 2012
    Link to this post
    Steve,

    Would saving the settings to a config file of some sort work? When the control loads, it would  parse the file and display all the different configurations to the user. When a user saves the settings, it would look through the file and, if it finds that the settings are custom, add the new configuration to the list.

    That would make it easy to add in new configurations later and keep you from having to make 10 of the same controls.

    -Tim
  3. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    03 Feb 2012
    Link to this post
    This is an excellent suggestion Tim, and actually Sitefinity has a pretty solid configuration framework built right in.

    Take a look at this recent blog post: Creating Custom Configuration Settings in Sitefinity 4

    you can use this to easily store the conguration, including default values.

    hope this is helpful!
3 posts, 0 answered