Include embedded resource in the JavaScript widget?

Posted by Community Admin on 03-Aug-2018 08:58

Include embedded resource in the JavaScript widget?

All Replies

Posted by Community Admin on 26-Feb-2013 00:00

Hey, guys!

We may be missing something but we couldn't find a way to embed a script resource using the JavaScript widget?

For example is there a way to include KendoUI / jQuery / other Sitefinity embedded resources without code but from the page designer instead?

Posted by Community Admin on 01-Mar-2013 00:00

Hi Pavel,

You are correct that embedded css and javascripts cannot be included in the your project with the javascript or teh css widget. However, you can add them to the master page, which is used by your template (or on the template of a control) with the ResourceLinks control. Here's an example:

<sitefinity:ResourceLinks runat="server" UseEmbeddedThemes="true" Theme="Basic">
    <sitefinity:ResourceFile JavaScriptLibrary="JQuery"/>
    <sitefinity:ResourceFile Name="MyContent.Common.common.js" AssemblyInfo="MyContent.TabStrip.TabStripLayout, MyContent" Static="True" />
    <sitefinity:ResourceFile Name="MyContent.Common.Designer.css" AssemblyInfo="MyContent.TabStrip.TabStripLayout, MyContent" Static="True" />
    <sitefinity:ResourceFile Name="MyContent.TabStrip.Resources.TabStrip.css" AssemblyInfo="MyContent.TabStrip.TabStripLayout, MyContent" Static="True" />
    <sitefinity:ResourceFile Name="MyContent.TabStrip.Resources.TabStrip.js" AssemblyInfo="MyContent.TabStrip.TabStripLayout, MyContent" Static="True" />
</sitefinity:ResourceLinks>
It is important to know that all static files, which are embedded in the assembly of your module, should be marked as EmbeddedResource in their Properties and registered in the AssemblyInfo.cs file of the module, as following:
[assembly: WebResource("MyContent.TabStrip.Resources.configurator.png", "image/png")]
[assembly: WebResource("MyContent.TabStrip.Resources.tabcontainer.png", "image/png")]
[assembly: WebResource("MyContent.TabStrip.Resources.tablayouts.png", "image/png")]
[assembly: WebResource("MyContent.TabStrip.Resources.TabStrip-min.css", "text/css", PerformSubstitution = true)]
[assembly: WebResource("MyContent.TabStrip.Resources.TabStrip.css", "text/css", PerformSubstitution = true)]
[assembly: WebResource("MyContent.TabStrip.Resources.TabStrip.js", "text/javascript")]
[assembly: WebResource("MyContent.TabStrip.Resources.tabstripcontainer.png", "image/png")]
[assembly: WebResource("MyContent.TabStrip.Resources.TabStripDesigner.js", "text/javascript")]
You can find more information about our Sitefinity ResourceLinks control, following the link.

Kind regards,
Jen Peleva
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