1

i just started using craft on a local domain and i have some issues. my stylesheet(a few files) are loaded using html<link rel="stylesheet" href="style/style.css">, and it works great for css and js files, but files requested from within the css aren't loading. for example the Font Awesome @fontface.

Any ideas? and the is any issue using html instead of the {{ getHeadHtml() }} method?

Thanks Ahead!

Samuel E.
  • 239
  • 1
  • 7

1 Answers1

1

For static assets I usually use something like this:

{% if craft.debugMode %}
    {% set assetsUrl = siteUrl %}
{% else %}
    {% set assetsUrl = "assets.mysite.com" %}
{% endif %}

And then I can set assets URL's the same way as navigation URLs. ie.

{% includeJsFile assetsUrl ~ "js/init.js" %}

{% includecss %}
body.landing #page-wrapper {
    background-image: url(" {{ assetsUrl }}img/pic01.jpg  }}");

}
{% endincludecss %}
j00lz
  • 769
  • 5
  • 22