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

Forums / Developing with Sitefinity / Store stylesheets and javascript files as widget templates?

Store stylesheets and javascript files as widget templates?

4 posts, 0 answered
  1. Basem
    Basem avatar
    131 posts
    Registered:
    22 Dec 2010
    01 Oct 2012
    Link to this post
    Is there a way to store stylesheets and javascript content as widget templates? I would like to leverage admin code editor and link them on the site. That way, designers and developers can modify these files without going into the server. Any ideas on how to accomplish something like this?
  2. MB
    MB avatar
    302 posts
    Registered:
    09 Jan 2005
    02 Oct 2012
    Link to this post
    I thought there were standard controls for this, in the page editor, under category: Scripts & Styles. They allow you to either link to a file, or write embedded Scripts/Styles.
  3. Basem
    Basem avatar
    131 posts
    Registered:
    22 Dec 2010
    02 Oct 2012
    Link to this post
    You are right there is. But what I am trying to do is a bit different and would like to load these stylesheets and javascript files asynchronously via a client-side app. So I would have 10 Javascript "modules" and load them on demand across pages via AMD / RequireJS. Here is a sample that I am trying to integrate with Sitefinity: http://goo.gl/zXsH9
  4. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    21 Aug 2017
    04 Oct 2012
    Link to this post
    Hi,

    Widget templates always relate to a type and for each type (custom widget type) deriving from SimpleView you can register widget template as described in this blog post. If the layout template contains the full CSS and Javascript code then it can be editiable in widget template, however for css/js file that is referenced it will not work because the widget template won`t be mapped to the type of the widget inheriting from simple view.

    Regards,
    Stanislav Velikov
    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
4 posts, 0 answered