External Widget Templates
I am having some issues external widgets and need some help.
I am working with the News widget. I create a new UserControl and put it in a UserControls folder. I also changed CodeBehind to CodeFile. In Sitefinity I created the page and a News widget and then change the TemplatePath to my control. I get the code for the templates from the built-in news templates in the internal template creator and only add additional items to it (I dont remove anything). Every time I do this it says "Error parsing template". I was able to get two of my templates to eventually work but I don't know how they started working.
Do you have any suggestions or ideas about what is going on?
We don't want to use virtual paths because of the naming scheme that is needed for the widget templates so switching to that is not an option.
Hello Todd,
Please take a look at the attached sample video I've recorded for you, which describes how to create and map an external template for the News widget in Sitefinity. If you have any additional questions, please let us know.
Greetings,
Boyan Barnev
the Telerik team
Does this also apply for the NewsFrontendDetails?
Hello Jkregala,
Yes, the same approach can be used to edit the DetaisView template for any of the built-in ContentView widgets (Blogs, News, Events). For more examples on different ways to use external templates for your controls, take a look at these blog posts:
Customizing Sitefinity 4 Controls with the ViewMap
Mapping External Templates for Sitefinity 4 Widgets
Best wishes,
Boyan Barnev
the Telerik team
I am having a problem with this solution. I am on SF 4.4 and I have created a custom content type via the Module Builder. I now have an .ascx usercontrol I want to use for the detailview template so I can take advantage of my codebehind logic. I have tried using the steps below by putting the path of my .ascx in the detailview definition (~/custom/professionalbio.ascx) and deleting the original template key id. I can't get it to use my template. I've even gone so far as to restart IIS to remove any possible caching of the old internal template.
I followed the sample video and other tutorial posts line-for-line and still have this issue.
It appears this may be an issue with the module builder. The team is aware and is looking into it, thank you all for reporting your feedback with this issue!
In the meantime, here is a workaround that I've tested that can work until we hear back official word from the support team.
Mapping External Templates for Sitefinity 4 Widgets
If you look at Option 2, you can create a physical template file in the folder ~/SfCtrlPresentation/ using the naming convention described and the Guid for the template from the Advanced settings of the dynamic module widget.
If you name everything correctly, the control will automatically pick up the external template file instead of the embedded one. just be sure to build your project if you are using a full user control (code behind).
I hope this is helpful, let me know if you encounter issues or have additional questions!
Thanks! I did this and got it to work. Seems 4.4 sure had a LOT of bugs. :)
Has this changed with Sitefinity 5? I tried adding the template path to master list view but my template is not used. Is there any other settings that need to be made? I tried ViewVirtualPath setting but didn't seem to help. I used the instructions above and it works but can someone let me know if this has changed.
Has this changed with Sitefinity 5? I tried adding the template path to master list view but my template is not used. Is there any other settings that need to be made? I tried ViewVirtualPath setting but didn't seem to help. I used the instructions above and it works but can someone let me know if this has changed.
I'm also having trouble getting this to work. I'm using Sitefinity 5 and have tried both options 1 and 2 in the blog post and neither seem to be picking up the template. The news item details page will load without any obvious errors but no content loads inside it. I threw a breakpoint on the Page_Load function and it isn't even getting executed.
I got it working, didn't realize that the ID of the RadListView needed to be hardcoded as "DetailsView". Sorry for re-opening the issue.