adding css to single page

Permalink
Hi,

I have created a single dashboard page, I want to add css to it but have tried
$this->addHeaderItem($html->css('mystyle.css', 'css')); in both the view and the page.

How can I add (in the header) a css file?
Where should I put the css file?
If the error "Call to a member function css() on a non-object" happening because it cannot find the css file or because the method call is illegal?

I do not want to edit core themes header but add the css later.

 
JohntheFish replied on at Permalink Reply
JohntheFish
You need to create a controller for your single page, and ideally put addHeaderItem for the css within an On Start event handler function.

Alternatively, you could build it into the single page for your theme using a similar line to those used in the header element of the theme. But it would need to be before the <body> tag, so the feasibility of doing this depends on how your theme is structured.
roscoeh replied on at Permalink Reply
The css file was simply missing (it has to be in /css or concrete/css) so in my single page file I added

$this->addHeaderItem($html->css('mystyle.css'));