<p>I have 2 x sites with base URLs set to <code>@web/en/</code> and <code>@web/de/</code></p>

<p>For client entries in a "Clients" section, I have a template at <code>templates/clients/_entry.twig</code> which I want to use for both sites.</p>

<p>What should the Entry URI Format be set to in the Clients section... eg should it be <code>clients/{slug}</code> for both sites? Or should the base url be included in these dynamically somehow?</p>

<p>(New to localisation so please excuse me if I'm doing this totally wrong!)</p>

<hr>

<p>UPDATE: if I set the URI to <code>clients/{slug}</code> and view <code>en/clients/clientname</code> I get this error... </p>

<blockquote>
  <p>Warning: chdir(): No such file or directory (errno 2) in
  /Users/jamesgreig/.composer/vendor/laravel/valet/server.php on line
  145</p>
  
  <p>Warning:
  require(/Users/jamesgreig/Repos/hoskins-craft/web/en/index.php):
  failed to open stream: No such file or directory in
  /Users/jamesgreig/.composer/vendor/laravel/valet/server.php on line
  147</p>
  
  <p>Fatal error: require(): Failed opening required
  '/Users/jamesgreig/Repos/hoskins-craft/web/en/index.php'
  (include_path='.:/usr/local/Cellar/php@7.1/7.1.16/share/pear') in
  /Users/jamesgreig/.composer/vendor/laravel/valet/server.php on line
  147</p>
</blockquote>

CC BY-SA 3.0
2018-04-09T09:50:10.870Z
Did you create the `en` and `de` folders, and place an index file in both? Because that's what Valet is warning you about. You should have two folders, each with their own index file, and then use define('CRAFT_LOCALE', 'en') and define('CRAFT_LOCALE', 'de') to tell Craft which locale to use for that site (or, if it's Craft 3, I think the constant is CRAFT_SITE).
Paul
CC BY-SA 3.0
2018-04-09T10:48:09.757Z
Ah I missed that! So now I get....

`Notice: Use of undefined constant CRAFT_BASE_PATH - assumed 'CRAFT_BASE_PATH' in /Users/jamesgreig/Repos/hoskins-craft/web/en/index.php on line 8

Warning: require_once(CRAFT_BASE_PATH/vendor/autoload.php): failed to open stream: No such file or directory in /Users/jamesgreig/Repos/hoskins-craft/web/en/index.php on line 11

Fatal error: require_once(): Failed opening required 'CRAFT_BASE_PATH/vendor/autoload.php' (include_path='.:/usr/local/Cellar/php@7.1/7.1.16/share/pear') in /Users/jamesgreig/Repos/hoskins-craft/web/en/index.php on line 11`
James Greig
<localization><craft3>
Confused by template and URI settings for multi-lingual sites
# Confused by template and URI settings for multi-lingual sites

(Asked by: username_0 on 2018-04-09)

I have 2 x sites with base URLs set to `@web/en/` and `@web/de/`

For client entries in a "Clients" section, I have a template at `templates/clients/_entry.twig` which I want to use for both sites.

What should the Entry URI Format be set to in the Clients section... eg should it be `clients/{slug}` for both sites? Or should the base url be included in these dynamically somehow?

(New to localisation so please excuse me if I'm doing this totally wrong!)

---

UPDATE: if I set the URI to `clients/{slug}` and view `en/clients/clientname` I get this error...

> Warning: chdir(): No such file or directory (errno 2) in
> /Users/jamesgreig/.composer/vendor/laravel/valet/server.php on line
> 145
>
> Warning:
> require(/Users/jamesgreig/Repos/hoskins-craft/web/en/index.php):
> failed to open stream: No such file or directory in
> /Users/jamesgreig/.composer/vendor/laravel/valet/server.php on line
> 147
>
> Fatal error: require(): Failed opening required
> '/Users/jamesgreig/Repos/hoskins-craft/web/en/index.php'
> (include\_path='.:/usr/local/Cellar/php@7.1/7.1.16/share/pear') in
> /Users/jamesgreig/.composer/vendor/laravel/valet/server.php on line
> 147

**Tags:** localization, craft3
> **Comments:**
> **username_1**: Did you create the `en` and `de` folders, and place an index file in both? Because that's what Valet is warning you about. You should have two folders, each with their own index file, and then use define('CRAFT_LOCALE', 'en') and define('CRAFT_LOCALE', 'de') to tell Craft which locale to use for that site (or, if it's Craft 3, I think the constant is CRAFT_SITE).  
> **username_0**: Ah I missed that! So now I get....  `Notice: Use of undefined constant CRAFT_BASE_PATH - assumed 'CRAFT_BASE_PATH' in /Users/jamesgreig/Repos/hoskins-craft/web/en/index.php on line 8  Warning: require_once(CRAFT_BASE_PATH/vendor/autoload.php): failed to open stream: No such file or directory in /Users/jamesgreig/Repos/hoskins-craft/web/en/index.php on line 11  Fatal error: require_once(): Failed opening required 'CRAFT_BASE_PATH/vendor/autoload.php' (include_path='.:/usr/local/Cellar/php@7.1/7.1.16/share/pear') in /Users/jamesgreig/Repos/hoskins-craft/web/en/index.php on line 11`  

---

## 0 answers

