Page 1 of 1

[SOLVED] {cms_stylesheet} tag not combining stylesheets

Posted: Mon Jul 09, 2012 11:45 am
by cypher6x
Hi

I have a cmsms installation 1.10.3 which I have been upgrading since version 1.3.

I have been using the {cms_stysheet} tag since it was introduced and it is placed in the <head> section of the template just like this

Code: Select all

{cms_stysheet}
I expect the stylesheets to be combined the out put is still one link per stylesheet like below

Code: Select all

<link rel="stylesheet" type="text/css" href="http://www.example.com/tmp/cache/stylesheet_77b7120576d3bf8ef7f990847075d390.css" media="screen"/>
<link rel="stylesheet" type="text/css" href="http://www.example.com/tmp/cache/stylesheet_5210570935bf6e18b07424e75fb6924f.css" media="screen"/>
(+ 17 more)........
I have a total of 17 stylesheets applied to the templates. I have another template with only 4 stylesheets applied and in this case, the output has a combined stylesheet.

Is there a limit on the number of stylesheets you can have on a template to enable combining?

I have tested by using the template which only had 4 and adding 13 more and again the output was not combined.

Re: {cms_stylesheet} tag not combining stylesheets on output

Posted: Mon Jul 09, 2012 11:48 am
by uniqu3
only if stylesheet have same media type are combined.
Behavior has been improved for 1.11 so best to wait for final ;)

Re: {cms_stylesheet} tag not combining stylesheets on output

Posted: Mon Jul 09, 2012 1:09 pm
by cypher6x
Yup, I noticed that whilst looking at the code.

I assume when you combine in 1.11 you will use

Code: Select all

@media screen
{
....stylesheet 1 contents
}

@media screen, handheld
{
....stylesheet 2 contents
}

@media print
{
....stylesheet 3 contents
}
I looks pretty easy to add in the cms_stylesheet plugin.

If so, i will make the modifications locally and hopefully the upgrade won't affect the functionality.

Re: [SOLVED] {cms_stylesheet} tag not combining stylesheets

Posted: Mon Jul 09, 2012 2:26 pm
by uniqu3
You can use inline media queries in 1.10.3, that has nothing to do with 1.11.
I can not imagine having stylesheets scattered across 17 files but you can also only attach "screen" media type to your template and include other stylesheet simply in template like {cms_stylesheet name='my-print-template'} and so on.