How can I set dynamic absolute Asset URLs? I'm working on my first subfolder-based Craft site, so I'm relying on Asset URLs based on the {{ siteUrl }} variable. I cannot, however, manage to get them working. Any tags I add to the URL field in the control panel get printed literally (not parsed) in the template output.

My config.php looks like this:



return array(

    '*' =&gt; array(
    ),

    'foo.craft.dev' =&gt; array(
        'siteUrl' =&gt; 'http://foo.craft.dev/',
        'devMode' =&gt; true
    ),

    'foo.bar.com' =&gt; array(
        'siteUrl' =&gt; 'http://foo.bar.com/',
        'devMode' =&gt; true
    ),

    'example.com' =&gt; array(
        'siteUrl' =&gt; 'http://example.com/foo',
        'devMode' =&gt; false
    ),

);


My Logos Asset settings look like this:



And a relevant chunk of template looks like this:

&lt;div class="logos"&gt;
    {% for logo in logos.logoImages %}
        &lt;a href="{{ logo.websiteUrl }}" target="_blank" style="background-image: url({{ logo.geturl() }}); padding-top: {{ logo.getHeight() }}px; width: {{ logo.getWidth() }}px;"&gt;{{ logo.companyName }}&lt;/a&gt;
    {% endfor %}
&lt;/div&gt;


The background-image URL above renders out as {siteUrl}assets/logos/logo.gif, which isn't parsed as I would expect.

What have I done wrong?
If you want to use the {siteUrl} tag in your Asset source settings, you'll still additionally need to define it in your environment variables as well.

See here as well.