Store stylesheets and javascript files as widget templates?

Posted by Community Admin on 04-Aug-2018 22:58

Store stylesheets and javascript files as widget templates?

All Replies

Posted by Community Admin on 01-Oct-2012 00:00

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?

Posted by Community Admin on 02-Oct-2012 00:00

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.

Posted by Community Admin on 02-Oct-2012 00:00

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

Posted by Community Admin on 04-Oct-2012 00:00

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

This thread is closed