Including a stylesheet with a module
Two questions on this topic.
Hi Joe Keller,
1. In AssemblyInfo you can add reference to your stylesheets
[assembly: WebResource(
"Telerik.Samples.Resources.Themes.MyBackenTheme.Global.Layout.css"
,
"text/css"
, PerformSubstitution =
true
)]
So, I guess my workaround for this issue will be as follows:
1.) embed the stylesheet as a resource
2.) During the module install I will write the stylesheet out to a styles directory in the site
3.) Then, I will end up making my own editor to allow the end-users to make changes to the stylesheet from the modules administrative section (I might extend the content editor to do this.. not sure yet)
But, my basic goal is to have a stylesheet deployed when I install the module, and then allow a semi-technical designer to make changes to the stylesheet without needing access to the site in visual studio or even accessing the file system directly.
Hello Joe Keller,
If the stylesheet is embedded resource to the module you cannot edit it or apply changes to it, because this requires to recompile the assembly. You can use ResourceLinks
control and make reference to resource that are not compiled, located in your project.. This will allow you to update them through an editor.
<
sitefinity:ResourceLinks
id
=
"resourcesLinks"
runat
=
"server"
>
<
sitefinity:ResourceFile
Name
=
"Skins/Foo.css"
/>
</
sitefinity:ResourceLinks
>
Hi Ivan,
Thank you for your continued interest and responses on this thread and forum.
I only plan on embedding the stylesheet as resource so that it is part of the module library. Once I run the install method in the module I will use the file system and write an actual local copy of the stylesheet out of the resource into a physical directory in the site.
I will have the templates in the module reference the stylesheet in the local file system, not the one in the resources, that way I can then allow administrators to make changes to the stylesheet.
Joe