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

Forums / Developing with Sitefinity / External Widget Templates

External Widget Templates

12 posts, 1 answered
  1. Todd
    Todd avatar
    6 posts
    Registered:
    03 Aug 2011
    04 Aug 2011
    Link to this post
    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. 
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    16 Aug 2017
    09 Aug 2011
    Link to this post
    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
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    08 Nov 2011
    Link to this post
    Does this also apply for the NewsFrontendDetails?
  4. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    16 Aug 2017
    10 Nov 2011
    Link to this post
    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
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. SVA Webmaster
    SVA Webmaster avatar
    85 posts
    Registered:
    18 Jul 2007
    06 Jan 2012
    Link to this post
    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.

    This is critical to me at this point and would appreciate any assistance anyone can give.

    Thanks!
  6. SVA Webmaster
    SVA Webmaster avatar
    85 posts
    Registered:
    18 Jul 2007
    09 Jan 2012
    Link to this post
    I followed the sample video and other tutorial posts line-for-line and still have this issue.
  7. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    10 Jan 2012
    Link to this post
    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!
  8. SVA Webmaster
    SVA Webmaster avatar
    85 posts
    Registered:
    18 Jul 2007
    10 Jan 2012
    Link to this post
    Thanks! I did this and got it to work. Seems 4.4 sure had a LOT of bugs. :)
  9. Axe
    Axe avatar
    16 posts
    Registered:
    11 Feb 2007
    28 Apr 2012
    Link to this post
    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.
  10. Axe
    Axe avatar
    16 posts
    Registered:
    11 Feb 2007
    28 Apr 2012
    Link to this post
    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.
  11. Richard
    Richard avatar
    14 posts
    Registered:
    23 Apr 2012
    29 May 2012
    Link to this post
    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.

    Thanks
  12. Richard
    Richard avatar
    14 posts
    Registered:
    23 Apr 2012
    29 May 2012
    Link to this post
    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.
12 posts, 1 answered