<p>I am not convienced that using Craft localization feature is a (good) solution to do multi-sites. But regarding you problem, did you try to add <code>craft.local</code> as part of a <a href="http://buildwithcraft.com/docs/assets-fields#dynamic-subfolder-paths" rel="nofollow">Dynamic Subfolder Paths</a> configuration. That could work for you.</p>

CC BY-SA 3.0
2015-10-30T12:28:34.757Z
Thanks Carl

I've tried this approach which works but the main problem is that assets for other locales remain visible in the assets modal, which we're trying to avoid
Cole Henley
CC BY-SA 3.0
2015-10-30T12:31:02.517Z
Did you have "Restrict uploads to a single folder?" set to true?
carlcs
CC BY-SA 3.0
2015-10-30T12:51:18.497Z
yes, but even removing shows everything contained within that folder, rather than anything specific to that locale
Cole Henley
CC BY-SA 3.0
2015-10-30T12:57:50.170Z
You could modify that plugin for you needs: [Asset Subfolder Access](https://github.com/pixelandtonic/AssetSubfolderAccess). Other than that I've no idea what you could do. If it was me, I wouldn't mis-use the localization feature to begin with.
carlcs
CC BY-SA 3.0
2015-10-30T12:07:06.300Z
2015-10-30T12:07:06.300Z
carlcs
<p>Is there a way to specify locale-specific asset paths so that uploaded images are only viewable on a per-locale basis, or would I have to set distinct assets (and ergo distinct fields) for each locale I wanted to provide uploads for?</p>

<p>For example, if am using locales to set a site A and a site B, can I have the same asset field declared but reference a different set of assets if they are logged in to site A rather than site B?</p>

<p>I've done some digging and testing and it looks like I can specify a locale in the general config, eg if following are declared in config (with <code>LOCALE</code> being defined in index.php based on locale :</p>

<pre><code>'asset_path' =&gt; $_SERVER['DOCUMENT_ROOT'] . '/resources/' . LOCALE . '/',
'asset_url' =&gt; 'http://' . $_SERVER['SERVER_NAME'] . '/resources/' . LOCALE . '/',
</code></pre>

<p>However, despite this uploading files correctly (depending on context) these are still visible in the admin/control panel from other locales.</p>

<p>Is this at all possible? Working on a site with 6 locales that needs to keep assets separate and would rather not have to set multiple asset paths/file destinations and ergo multiple field types to achieve this.</p>

<p>Ta,</p>

<p>Cole</p>

<assets><localization><multi-domain><multi-site>
Locales and assets
# Locales and assets

(Asked by: username_0 on 2015-10-30)

Is there a way to specify locale-specific asset paths so that uploaded images are only viewable on a per-locale basis, or would I have to set distinct assets (and ergo distinct fields) for each locale I wanted to provide uploads for?
For example, if am using locales to set a site A and a site B, can I have the same asset field declared but reference a different set of assets if they are logged in to site A rather than site B?
I've done some digging and testing and it looks like I can specify a locale in the general config, eg if following are declared in config (with LOCALE being defined in index.php based on locale :
'asset_path' => $_SERVER['DOCUMENT_ROOT'] . '/resources/' . LOCALE . '/',
'asset_url' => 'http://' . $_SERVER['SERVER_NAME'] . '/resources/' . LOCALE . '/',

However, despite this uploading files correctly (depending on context) these are still visible in the admin/control panel from other locales.
Is this at all possible? Working on a site with 6 locales that needs to keep assets separate and would rather not have to set multiple asset paths/file destinations and ergo multiple field types to achieve this.
Ta,
Cole

**Tags:** assets, localization, multi-domain, multi-site


---

## 1 answers

### Answer by username_1 on 2015-10-30. Score: 1

I am not convienced that using Craft localization feature is a (good) solution to do multi-sites. But regarding you problem, did you try to add `craft.local` as part of a [Dynamic Subfolder Paths](http://buildwithcraft.com/docs/assets-fields#dynamic-subfolder-paths) configuration. That could work for you.

> **Comments:**
> **username_0**: Thanks Carl  I've tried this approach which works but the main problem is that assets for other locales remain visible in the assets modal, which we're trying to avoid  
> **username_1**: Did you have "Restrict uploads to a single folder?" set to true?  
> **username_0**: yes, but even removing shows everything contained within that folder, rather than anything specific to that locale  
> **username_1**: You could modify that plugin for you needs: [Asset Subfolder Access](https://github.com/pixelandtonic/AssetSubfolderAccess). Other than that I've no idea what you could do. If it was me, I wouldn't mis-use the localization feature to begin with.  

---

