Technical support This forum is closed.
Version 1.x > Technical support > Using multiple stylesheets View modes: 
User avatar
Member
Member
ahmed - 1/20/2006 12:02:29 AM
   
Using multiple stylesheets
hi all,

i am in a position where the site that i am building has multiple stylesheets. on the order of 5. as it turns out, i have different stylesheets for the home page, versus pages that are going to be editable content areas dependent on the page template.

because i have multiple stylesheets, so far i have avoided using the GetPageTags function, and instead added styles to each page template via HTML, like so:

<style type="text/css">@import url(styles/home.css);</style>
<style type="text/css" media="print">@import url(styles/print.css);</style>

while this worked for the home page, when i apply this to the page template and add a content area using the template, the styles are not applied.

my questions are:
- is there any pattern/approach to use multiple stylesheets with kentico?
- is the CMSCSSVirtualPath config setting the only way to specify a stylesheet?
- why is the style being applied at the template level but not on dependent content areas?

any info will be greatly appreciated.

thanks
ahmed

User avatar
Guest
admin - 1/20/2006 11:36:52 AM
   
Re: Using multiple stylesheets
Hello,

you may want to modify the Functions.GetCSSFileLink link so that it renders the stylesheets as required.

The URLs of the stylesheets must be either absolute or you must use the ResolveUrl method to get the correct path as the document URLs are not in the root of the web site. Here's an example:

<style type="text/css"><%= ResolveUrl("~/styles/home.css")</style>

Best Regards,