Answers.Body: <p>You could create 2 site groups. One group for site A and one group for site B. </p>
  
  <p>Sitegroup A will contain contain 2 sites, the other one only one site.
  Your setup will look like this</p>
  
  <pre><code>SiteGroup A
      - Site A - language NL
      - Site A - language Fr
  SiteGroup B
      - Site B - language Fr
  </code></pre>
  
  <p>Let's imagine your <code>Site A - language Fr</code> is your primary site. So it will have the base url <code>/</code>. Your <code>Site A - language NL</code> have the base url <code>/nl</code>.</p>
  
  <p>Your <code>Site B - language Fr</code> will have the url <code>whatever.you.like.fr</code>.
  You don't need multiple <code>web</code> folders at all because Craft will route every request to <code>web/index.php</code> and sets the <code>currentSite</code> depending on the url structure.</p>
  
  <p>Now you have multiple ways to setup your asset structure. You can either create multiple <a href="https://github.com/craftcms/docs/blob/v3/en/asset-bundles.md" rel="nofollow noreferrer">Asset Bundles</a> in a plugin and load the assets you need or you can just check in your template</p>
  
  <pre><code>{% if currentSite.id == 1 %}
      load these assets
  {% else %}
      load other assets
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-01T14:25:18.270Z
Answers.LastActivityDate: 2018-04-01T14:25:18.270Z
Answers.UserDisplayName: Robin Schambach
Body: <p>I have 2 almost identical websites. Both have almost the same layout but different colors (so different CSS file). They share most of the same templates and assets (images, css, js, videos, etc.).</p>
  
  <p>Site A has two languages NL and FR.
  Site B has only one language FR.</p>
  
  <p>Both sites have their own TLD.</p>
  
  <p>How do I set this up in Craft 3? I have tried various ways, but I don't seem to be able to find the right solution.</p>
  
  <p>I was thinking about creating two separate web folders, one for site A and one for site B. With subfolders for nl and fr in the webfolder for site A.
  That works, but than I have the problem that I cannot share my assets because they belong to different webfolders.
  And if I want to share a product channel for example, when I upload a product image, I want to use that same image in both sites. How will that work?</p>
  
  <p>Also the baseUrl is a mystery to me. If I use @web/nl and @web/fr for site A and @web for site B, the @web gives the correct TLD as output, but the template from site B (which uses @web) are always loaded.</p>
  
  <p>If I try to forgo to separate web folders, it totaly goes wrong...</p>
  
  <p>Can someone please give a working example?</p>
  
Tags: <localization><craft3><multi-site><multi-domain>
Title: Craft 3 multi-lingual multi-sites setup with shared assets
ThreadText: # Craft 3 multi-lingual multi-sites setup with shared assets
  
  (Asked by: username_0 on 2018-04-01)
  
  I have 2 almost identical websites. Both have almost the same layout but different colors (so different CSS file). They share most of the same templates and assets (images, css, js, videos, etc.).
  
  Site A has two languages NL and FR.
  Site B has only one language FR.
  
  Both sites have their own TLD.
  
  How do I set this up in Craft 3? I have tried various ways, but I don't seem to be able to find the right solution.
  
  I was thinking about creating two separate web folders, one for site A and one for site B. With subfolders for nl and fr in the webfolder for site A.
  That works, but than I have the problem that I cannot share my assets because they belong to different webfolders.
  And if I want to share a product channel for example, when I upload a product image, I want to use that same image in both sites. How will that work?
  
  Also the baseUrl is a mystery to me. If I use @web/nl and @web/fr for site A and @web for site B, the @web gives the correct TLD as output, but the template from site B (which uses @web) are always loaded.
  
  If I try to forgo to separate web folders, it totaly goes wrong...
  
  Can someone please give a working example?
  
  **Tags:** localization, craft3, multi-site, multi-domain
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-04-01. Score: 4
  
  You could create 2 site groups. One group for site A and one group for site B.
  
  Sitegroup A will contain contain 2 sites, the other one only one site.
  Your setup will look like this
  
  ```
  SiteGroup A
      - Site A - language NL
      - Site A - language Fr
  SiteGroup B
      - Site B - language Fr
  
  ```
  
  Let's imagine your `Site A - language Fr` is your primary site. So it will have the base url `/`. Your `Site A - language NL` have the base url `/nl`.
  
  Your `Site B - language Fr` will have the url `whatever.you.like.fr`.
  You don't need multiple `web` folders at all because Craft will route every request to `web/index.php` and sets the `currentSite` depending on the url structure.
  
  Now you have multiple ways to setup your asset structure. You can either create multiple [Asset Bundles](https://github.com/craftcms/docs/blob/v3/en/asset-bundles.md) in a plugin and load the assets you need or you can just check in your template
  
  ```
  {% if currentSite.id == 1 %}
      load these assets
  {% else %}
      load other assets
  {% endif %}
  
  ```
  
  
  ---
  
  