1

I have a multi language site with /nl and /en in my url.

  • mysite.dev/nl
  • mysite.dev/en

This is my configuration on general.php

'mysite.dev' => array(
    'devMode' => true,
    'translationDebugOutput' => false,
    'siteUrl' => array(
        'nl' => '//mysite.dev/nl/',
        'en' => '//mysite.dev/en/',
    ),
    'environmentVariables' => array(
        'siteUrl'        => 'http://mysite.dev/',
        'basePath' => '/Users/lisavandaele/documents/mysite/public/',
        'baseUrl'    => 'http://mysite.dev/'),

),

In my asset transform settings I made: thumb (width 120, height 90, crop)

In my twig I use:

{% set asset = entry.afbeelding.first() %}
            {% if asset %}
                <img src="{{ asset.getUrl('thumb') }}" width="{{ asset.getWidth('thumb') }}" height="{{ asset.getHeight('thumb') }}" alt="{{entry.title}}" /><br />
             {% endif %}

The url he uses is: //mysite.dev/nl/cpresources/transforms/1?x=UeS4gtVAw

if I go to the url without the /nl, I can view the image and I see he is rendered in my assets. ==> //mysite.dev/cpresources/transforms/1?x=UeS4gtVAw

But how can I use the correct url without the language parameter (/nl or /en) so my image transforms and can be viewed on my site.

I tried lots of configs, what am I overlooking? I also cleared my cache and images evertime I changed my configuration but nothing worked...

6
  • You defined the variable 'siteUrl' twice in your code. Once as a 'environmentVariables'. maybe craft doesn't like that?
    – KSPR
    Jan 12 '15 at 10:47
  • good point, but that didn't fix it. But after looking at it again. I changed the URL in my settings for my image to {baseURl}img/news/ and that did it! Jan 12 '15 at 11:42
  • Then I guess your image url doesn't work because your standard language has a language segment as well. Normaly the standard language would be just this 'nl' => '//mysite.dev/',
    – KSPR
    Jan 12 '15 at 12:01
  • it is both, / == nl and /nl == nl. it is solved with the {basaeUrl} in my settings for the image url Jan 12 '15 at 13:04
  • 1
    @Lisa. You might want to add this as an answer. Jan 14 '15 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.