<p>I'm trying to do something like this in general.php config for a multi-site setup:</p>

<pre><code>// ...
'production' =&gt; array(
    'myVariable' =&gt; array(
        'site1Handle' =&gt; '111',
        'site2Handle' =&gt; '222',
    ),
),
// ...
</code></pre>

<p>So, when we do:</p>

<pre><code>{{ craft.app.config.general.myVariable }}
</code></pre>

<p>We can get different values ("111" or "222") based on which site I'm on.</p>

<p>I believe that we can do something similar to this in Craft 2 (was multi-lingual though). See <a href="https://docs.craftcms.com/v2/localization-guide.html#step-4-define-your-site-urls" rel="nofollow noreferrer">https://docs.craftcms.com/v2/localization-guide.html#step-4-define-your-site-urls</a></p>

<p>Can we still do this in Craft 3?</p>

CC BY-SA 4.0
2019-10-17T10:33:40.610Z
How about `{{ craft.app.config.general.myVariable[currentSite.handle] }}`?
Ded Nolyxeux
CC BY-SA 4.0
2019-10-22T02:12:01.513Z
@DedNolyxeux good solution. Thanks Ded!
Wei
<craft3><config><multi-site>
Craft 3 multisite: site specific config
# Craft 3 multisite: site specific config

(Asked by: username_0 on 2019-10-17)

I'm trying to do something like this in general.php config for a multi-site setup:
// ...
'production' => array(
    'myVariable' => array(
        'site1Handle' => '111',
        'site2Handle' => '222',
    ),
),
// ...

So, when we do:
{{ craft.app.config.general.myVariable }}

We can get different values ("111" or "222") based on which site I'm on.
I believe that we can do something similar to this in Craft 2 (was multi-lingual though). See https://docs.craftcms.com/v2/localization-guide.html#step-4-define-your-site-urls
Can we still do this in Craft 3?

**Tags:** craft3, config, multi-site

> **Comments:**
> **username_1**: How about `{{ craft.app.config.general.myVariable[currentSite.handle] }}`?  
> **username_0**: @DedNolyxeux good solution. Thanks Ded!  

---

## 0 answers

