Store stylesheets and javascript files as widget templates?
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?
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.
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
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