tags:

views:

15

answers:

1

In my master a partial _styles is loaded. In this _styles there is a ^var styles = "" Now in all my views or partials I can say var styles = styles+"another style"

Normally a style is defined as

%link{ href="../../content/css/partial.css" rel="stylesheet" type="text/css" }

How can I append the output of the %link directive to the styles variable?

A: 

I wrote a post about adding styles and links with the NHAML.
This should do all job for you.

Dmytrii Nagirniak
Thanks, I didn't know these existed: Html.Content().EmitCss(css)That should answer my question
borisCallens
These really DO NOT exist. These are my extension methods to siplify things on the view.
Dmytrii Nagirniak
In that case, how do you make sure the intendation of your output is correct?
borisCallens
NHAML indents the output, not me. Only one thing is that there will be empty lines if there are no CSS/JS files included. But I do not see how it can be an issue.
Dmytrii Nagirniak