2

Up till now, all my craft sites were single language. When including CSS and JS files from web folder, i used to use {{siteUrl}} variable, like this:

<script src='{{siteUrl}}/plugins/jquery.js'></script>

Such path was rendered to this:

<script src='http://website.com/plugins/jquery.js'></script>

Unfortunetly, on multilanguage websites, where different languages have different url path (site.com and site.com/en), {{siteUrl}} variable changes and paths to these files are incorrectly rendered, like this:

<script src='http://website.com/en/plugins/jquery.js'></script>

What variable can i use that will give me path to web folder - regardless of currently used language?

Brad Bell
  • 67,440
  • 6
  • 73
  • 143
Ded Nolyxeux
  • 133
  • 9

1 Answers1

3

Use the alias instead {{ alias('@web') }}

It will always point to your web directory

Robin Schambach
  • 19,713
  • 1
  • 19
  • 44