More in this section
Forums / Developing with Sitefinity / Looking for the best way to implement editable, reusable pieces of content

Looking for the best way to implement editable, reusable pieces of content

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. EricMarthinsen
    EricMarthinsen avatar
    1 posts
    15 Sep 2010
    05 Nov 2010
    Link to this post

    I've built a site in Sitefinity 3.6 that is a classic two column layout. On the left-hand side of the page is the main content and along the right-hand side of the page is a sidebar column that can be used for small widgets of content. Some of these widgets would be "contact us" information, popular FAQs, etc. Each of the sidebars on all of the pages will use a different combination of these widgets. Each widget is slightly different in the way the data is presented (e.g., one will have little tabs, one will have a LivePerson button, etc.).

    What I want to be able to do is have a collection of these reusable widgets. This part is easy. I can just create a bunch of user controls and add them to the toolbox. The catch is that I want the content within each of these widgets to be editable by content administrators (where the design of the widget allows it). For instance, the content administrator should be able to change the phone numbers in the "contact us" widget. Each widget is likely to have different pieces of data that should be edited (some will have text, some will have images, some will have both, etc.). When the content for a widget is modified, the edit should be pervasive across all widgets of that type (i.e., all "contact us" widgets will display the updated information).

    What is the best way to create a system like this, where there is a collection of widgets that draw from some global data that a content administrator can edit?

  2. George
    George  avatar
    204 posts
    05 Sep 2006
    05 Nov 2010
    Link to this post
    Hi Eric,

    I can think of these 2 options for you:

    You can try something like this ...

    1- Save your data in an xml or database table as follows

    Table: Controls_Config

    ID : varchar -> Control Name (Unique) [KEY]
    Property: varchar -> (name of the property that you want to save) [KEY}
    Value: varchar 

    Hence you will save all of your controls properties in one table and whenever you want to edit the properties of the control you will simply persist the data when editing any instance of your control.

    You can easily use LINQ to SQL or Open Access to persist your data.

    2- Follow the same methodology of option 1 but this time create a custom module to edit your controls properties from there.

    Best Regards,

2 posts, 0 answered