Widget Template no longer displayed in UI after change

Posted by Community Admin on 04-Aug-2018 15:02

Widget Template no longer displayed in UI after change

All Replies

Posted by Community Admin on 28-May-2013 00:00

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.

Posted by Community Admin on 28-May-2013 00:00

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

Posted by Community Admin on 30-May-2013 00:00

Thanks, Daniel,

That helped me solve my problem.

Regards,
David

This thread is closed