Answers.Body: <p>Did you <a href="http://buildwithcraft.com/help/localization" rel="nofollow">configure siteUrl</a> in <code>general.php</code>?</p>
  
  <pre><code>return array(
      // ...
      'siteUrl' =&gt; array(
          'en' =&gt; 'http://example.com/en/',
          'de' =&gt; 'http://example.com/de/',
      ),
  );
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-11T17:16:40.423Z
Answers.Text: Yes. Also in the index.php. I use a multi-environment config file and the site is multi-language.
Answers.UserDisplayName: Johannes Lamers
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-14T23:56:59.353Z
Answers.Text: @JohannesLamers Can you share what the relevant part of your multi-environment config looks like?
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-11T16:52:11.060Z
Answers.LastActivityDate: 2014-07-11T16:52:11.060Z
Answers.UserDisplayName: carlcs
Body: <p>Method "siteUrl" for object "Craft\ConfigVariable" does not exist</p>
  
  <pre><code>{% for locale in otherLocales %}
  
      {# Is this an entry page? #}
         {% if entry is defined %}
  
           {# Find the current entry in the other locale #}
          {% set localeEntry = craft.entries.id(entry.id).locale(locale).first %}
  
          {# Make sure that it's actually localized to this locale #}
         {% if localeEntry.locale == locale %}
  
             {# Output a link to it #}
              &lt;link rel="alternate" hreflang="{{ locale }}" href="{{ craft.config.siteUrl[locale] ~ (localeEntry.uri != '__home__' ? localeEntry.uri) }}"&gt;
           {% endif %}
  
      {% else %}
  
          {# Just output the same path with the locale's base URL #}
          &lt;link rel="alternate" hreflang="{{ locale }}" href="{{ craft.config.siteUrl[locale] ~ craft.request.getPath() }}"&gt;
      {% endif %}
  {% endfor %}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-07-11T18:10:37.193Z
Comments.Text: Please add more information to your question... specifically, code from config file showing how "siteUrl" is set...
Comments.UserDisplayName: Anna_MediaGirl
Tags: <localization><multi-environment>
Title: Template error: Method "siteUrl" for object "Craft\ConfigVariable" does not exist
ThreadText: # Template error: Method "siteUrl" for object "Craft\ConfigVariable" does not exist
  
  (Asked by: username_0 on 2014-07-11)
  
  Method "siteUrl" for object "Craft\ConfigVariable" does not exist
  
  ```
  {% for locale in otherLocales %}
  
      {# Is this an entry page? #}
         {% if entry is defined %}
  
           {# Find the current entry in the other locale #}
          {% set localeEntry = craft.entries.id(entry.id).locale(locale).first %}
  
          {# Make sure that it's actually localized to this locale #}
         {% if localeEntry.locale == locale %}
  
             {# Output a link to it #}
              <link rel="alternate" hreflang="{{ locale }}" href="{{ craft.config.siteUrl[locale] ~ (localeEntry.uri != '__home__' ? localeEntry.uri) }}">
           {% endif %}
  
      {% else %}
  
          {# Just output the same path with the locale's base URL #}
          <link rel="alternate" hreflang="{{ locale }}" href="{{ craft.config.siteUrl[locale] ~ craft.request.getPath() }}">
      {% endif %}
  {% endfor %}
  
  ```
  
  **Tags:** localization, multi-environment
  
  > **Comments:**
  > **username_1**: Please add more information to your question... specifically, code from config file showing how "siteUrl" is set...  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2014-07-11. Score: 4 | Accepted answer
  
  Did you [configure siteUrl](http://buildwithcraft.com/help/localization) in `general.php`?
  
  ```
  return array(
      // ...
      'siteUrl' => array(
          'en' => 'http://example.com/en/',
          'de' => 'http://example.com/de/',
      ),
  );
  
  ```
  
  > **Comments:**
  > **username_0**: Yes. Also in the index.php. I use a multi-environment config file and the site is multi-language.  
  > **username_3**: @username_0 Can you share what the relevant part of your multi-environment config looks like?  
  
  ---
  
  