Answers.Body: <p>If you want to use envVars as you would in the control panel i.e. <code>{baseUrl}</code> but, in your templates, then check out the <a href="https://github.com/lindseydiloreto/craft-filterenvvar/" rel="nofollow">Filter Environment Variables</a> plugin.</p>
  
  <blockquote>
    <p>Just apply the <code>envvar</code> filter to your Twig variable:</p>
  
  <pre><code>{% set myVar = '{baseUrl}/contact-us' %}
  
  {{ myVar | envvar }}
  </code></pre>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-07T06:44:00.467Z
Answers.LastActivityDate: 2015-04-07T06:44:00.467Z
Answers.UserDisplayName: Natetronn
Answers.Body: <p>You can get to any of your config variables (including custom ones) like this:</p>
  
  
  
  <pre class="lang-twig prettyprint-override"><code>{{ craft.config.xyz }}
  </code></pre>
  
  <p>The environmentVariables array is no different:</p>
  
  <pre class="lang-twig prettyprint-override"><code>{{ craft.config.environmentVariables.baseUrl }}
  </code></pre>
  
  <p>See the <a href="http://buildwithcraft.com/docs/templating/craft.config">craft.config</a> documentation.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-08T08:26:48.463Z
Answers.Text: Also, if you wanted to use the shorter version of `{{ baseUrl }}`, you could also add `{% set baseUrl = craft.config.environmentVariables.baseUrl %}` at the top of your template.
Answers.UserDisplayName: Alex Roper
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-12T14:06:17.707Z
Answers.Text: Cool. Thank you :)
Answers.UserDisplayName: KSPR
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-11T11:32:45.307Z
Answers.LastActivityDate: 2014-10-11T16:02:38.800Z
Answers.LastEditDate: 2014-10-11T16:02:38.800Z
Answers.UserDisplayName: André Elvan
Body: <pre><code>'dev' =&gt; array(
          'siteUrl' =&gt; array(
              'de_ch' =&gt; 'http://blabla.dev/',
              'en' =&gt; 'http://blabla.dev/en/',
          ),
          'environmentVariables' =&gt; array(
              'basePath' =&gt; 'path',
              'baseUrl' =&gt; 'http://url-without-locale-segment.dev/',
          )
      ),
  </code></pre>
  
  <p>I set a <code>baseUrl</code> inside <code>environmentVariables</code> to be able to grab the url without a locale. But when I enter <code>{{ baseUrl }}</code> in the template it returns an error:</p>
  
  <blockquote>
    <p>Variable "baseUrl" does not exist</p>
  </blockquote>
  
  <p>How do I have to write this?</p>
  
Tags: <config><multi-environment>
Title: grab 'environmentVariables' with a tag
ThreadText: # grab 'environmentVariables' with a tag
  
  (Asked by: username_0 on 2014-10-11)
  
  ```
  'dev' => array(
          'siteUrl' => array(
              'de_ch' => 'http://blabla.dev/',
              'en' => 'http://blabla.dev/en/',
          ),
          'environmentVariables' => array(
              'basePath' => 'path',
              'baseUrl' => 'http://url-without-locale-segment.dev/',
          )
      ),
  
  ```
  
  I set a `baseUrl` inside `environmentVariables` to be able to grab the url without a locale. But when I enter `{{ baseUrl }}` in the template it returns an error:
  
  > Variable "baseUrl" does not exist
  
  How do I have to write this?
  
  **Tags:** config, multi-environment
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2014-10-11. Score: 19 | Accepted answer
  
  You can get to any of your config variables (including custom ones) like this:
  
  ```twig
  {{ craft.config.xyz }}
  
  ```
  
  The environmentVariables array is no different:
  
  ```twig
  {{ craft.config.environmentVariables.baseUrl }}
  
  ```
  
  See the [craft.config](http://buildwithcraft.com/docs/templating/craft.config) documentation.
  
  > **Comments:**
  > **username_0**: Cool. Thank you :)  
  > **username_3**: Also, if you wanted to use the shorter version of `{{ baseUrl }}`, you could also add `{% set baseUrl = craft.config.environmentVariables.baseUrl %}` at the top of your template.  
  
  ---
  
  ### Answer by username_1 on 2015-04-07. Score: 3
  
  If you want to use envVars as you would in the control panel i.e. `{baseUrl}` but, in your templates, then check out the [Filter Environment Variables](https://github.com/lindseydiloreto/craft-filterenvvar/) plugin.
  
  > Just apply the `envvar` filter to your Twig variable:
  >
  > ```
  > {% set myVar = '{baseUrl}/contact-us' %}
  >
  > {{ myVar | envvar }}
  >
  > ```
  
  
  ---
  
  