Widget Template from usercontrol in VS project
I saw the video from Gabe about how you can add or edit widget templates to change the html output. In his example though, these were all persisted to the database, which makes for nice demo-ware but we know would not work in real life. In real life we have multiple developers working on a VS solution that is in source control, and we need to be able to publish changes from within VS.
In other words, we would expect the widget templates to be .ascx files living somewhere in our sitefinity project, ie. /Custom/WidgetTemplates/MyCustomImageGallery.ascx
How do we achieve this in Sitefinity 4.0?
Also, I would like to comment that from my experience, end users ie. our clients (from Fortune 100 companies to medium businesses), do not care about editing the HTML, they just want boxes where they can see a pre-defined template and fill in the boxes with their text or images. SF 4 is definitely a good step in that direction.
Best,
Hi James Reategui,
You could map the public control view to use an external template. You could achieve this either through Configurations or through the Property Editor of the public control.
1. Configuration approach is appropriate when you want to change the default template globally:
Thanks, yep, that does it.
Do these settings get persisted to the database or to config files in the project?
I saw the app_data/sitefinity/configuration files so I was wondering what these do and how they relate.
Hello James,
Changes which are made through Property Editor of the control, are saved in the database. While, configuration modifications are persisted in the configuration files located in App_Data/Sitefinity/Configurations folder. Note that control specific settings are treated with the greater priority i.e. if TemplatePath property is set both through Property Editor and Configurations, the database value will be used.
Actually, Settings page provides UI for editing configuration files. They contain all Sitefinity-specific settings, so that the web.config file includes only standard ASP.NET configurations. If a configuration is not set explicitly the default value is used. This means that Sitefinity upgrades do not override client configuration settings.
For more details please refer to the following documentation topic: System Configuration
All the best,
Pepi
the Telerik team
Does this still actually work? We have been trying to do this for a News widget (both master and details mode) with no success...
Yeah this seems to not be working for me either, it was working perfectly pre SP1 so I suspect that something in the latest service pack has caused this.
Hello Sean,
This is a known issue in the SP and it will be fixed in the upcoming Q1. Please, refer to the following forum thread that provides a workaround for the described problem: SP 1 NewsView LayoutTemplatePath not loading template
We are sorry for the inconvenience caused.
Regards,
Pepi
the Telerik team