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

Forums / Developing with Sitefinity / Widget Template no longer displayed in UI after change

Widget Template no longer displayed in UI after change

3 posts, 1 answered
  1. David van Geel
    David van Geel avatar
    59 posts
    Registered:
    19 Aug 2009
    28 May 2013
    Link to this post
    Hi,

    I am trying to implement the functionality blogged in http://www.sitefinity.com/blogs/slavo-ingilizovs-blog/2012/09/21/making-your-widget-templates-editable-through-the-ui and I have been able to get my Widget Template displayed in the UI as expected.

    The weird thing is that it is no longer displayed after i change something in the UI and save the changes. I can see that the template is still stored in the appropriate SQL table but the UI no longer displays it. When you take a look at a page using the Widget I can see that the template in the database is applied (and not the default one from the dll).

    Does anyone have an idea what my be causing this?

    Regards,
    David

    p.s. I am having this issue at a SF 5.4.4020 system. I have attached the cs file used to created the Widget Template in the database. Take a look at the InstallWidgetTemplatesInDatabase method.
  2. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    28 May 2013 in reply to David van Geel
    Link to this post
    Hi David,

    I just solved this issue a moment ago, so what I did was:

    • Created a Resource Class for my control
    • Annotated my control with this new class.

    So you can annotate it like this:

    [ControlTemplateInfo("ResourceClassName", "ControlTitleResource", "AreaNameResource")]

    The values should correspond with the Resource class.
    Then use these same values when you register your control template:

    initializer.RegisterControlTemplate(
                        "ControlsLayoutTemplateName",
                        typeof(YourControl).FullName,
                        "ControlTitleResourceValue",
                        areaName: "AreaNameResourceValue",
                        resourceAssemblyName: "assemblyNameOfTheResourceClass");

    Hope this helps.

    Kind regards,
    Daniel

    Answered
  3. David van Geel
    David van Geel avatar
    59 posts
    Registered:
    19 Aug 2009
    30 May 2013
    Link to this post
    Thanks, Daniel,

    That helped me solve my problem.

    Regards,
    David
3 posts, 1 answered