3217 Posts in 853 Topics by 812 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2018 Views |
-
Current best method for including print.css

23 October 2009 at 10:39pm
Hi,
Looking through the archives, I came across a suggestion for appending a print.css to a template by adding the following to your Page_Controller -> init method:
Requirements::themedCSS("print.css", "print")
However in the default Page.php document. it says the following.
// Note: you should use SS template require tags inside your templatesIs there one for the current version of SS for print.css? What is the current best method for including a print.css?
Thanks,
Sam -
Re: Current best method for including print.css

24 October 2009 at 12:31am
That is still currently the best way. I don't think <% require %> in templates support media types (such as print yet)
-
Re: Current best method for including print.css

25 October 2009 at 8:52am
Hi Will,
Thanks for your quick response. But I can't seem to get your suggestion to work.I added Requirements::themedCSS("print.css", "print") to Page.php, as in the following:
class Page_Controller extends ContentController {
public function init() {
parent::init();
Requirements::themedCSS("print.css", "print");
}I refreshed the database, yet their is no linked print. css code in the head of the index file when I go to view the page.ss.
I'm I missing something?
Sam
-
Re: Current best method for including print.css

25 October 2009 at 10:54am
themedCSS will add the .css for you. Just try Requirements::themedCSS('print', 'print');
| 2018 Views | ||
|
Page:
1
|
Go to Top |


