15 votes
Accepted

Craft 3 language switcher

The concept of localization has changed in Craft 3, there are not only locales anymore - now you have different sites and site groups. Example without multisite - only different locals You can get ...
user avatar
12 votes
Accepted

Can I run one Craft install on multiple domains and/or subdomains?

Update for Craft 3 Craft 3 includes native support for multi-site installation. Here's a link to the official docs and here's a link to another question with more resources. Old answer for Craft 1 &...
user avatar
  • 2,985
10 votes

Can I run one Craft install on multiple domains and/or subdomains?

Yes, it is possible to have a Craft install on multiple domains and subdomains as long as you only access the control panel from a single domain and you only have a single installation of craft that ...
user avatar
  • 6,682
9 votes
Accepted

How do I get the primary site URL?

You can output the primary site’s Base URL like this: {{ craft.app.sites.primarySite.baseUrl }} (craft.app.sites maps to craft\services\Sites.) If your Base URL begins with an alias, you will need ...
user avatar
8 votes
Accepted

Craft 3: how can I set dynamic Base URL in sites setting?

So as of Craft CMS 3 RC7, they added a new alias() Twig function. So what you can do is something like this in your general.php: 'aliases' => [ '@basePath' => getenv('CRAFTENV_BASE_PATH'), ...
user avatar
6 votes

Multi-site setup in Craft3

You can also check out the free video on it here: Using Craft CMS 3 Multi-site Multi-site has changed as of Craft 3 RC11. It now requires much less config outside of the control panel. See the ...
user avatar
6 votes
Accepted

Specifying administrators for localized sites?

Yes. you can: Here I created a User group which has only access to the english part of the content. As you can see these are checkboxes. So you can grant access to multiple languages at once.
user avatar
  • 3,664
6 votes
Accepted

Craft 3 Multi-site with no "default" site

This can be done in 3 main steps. 1. Get the site subdirectories working First just get the /en/ and /es/ subdirectory working: Create en/ and es/ subfolders in your webroot Each subfolder should ...
user avatar
5 votes

How to change the locals name in Localized Sites

You could add new pseudo localization files to Craft craft/app/framework/i18n/data/ and rename (translate) the name of your "language" and other things in these files. I'd use en.php as a starting ...
user avatar
  • 35.8k
5 votes

Craft 3 language switcher

Little addition with a fallback to the homepage and check if entry exist. currentSite is a global variable already defined in craft3 https://docs.craftcms.com/v3/templating/global-variables.html#...
user avatar
  • 308
5 votes
Accepted

Craft 3 multisite - are entries accessible between sites?

Yes it is. Just include the site id of the the site in your query set siteId = 2 set entries = craft.entries.section('foo').site(siteId).all() if you want to get the current entry for another site ...
user avatar
5 votes
Accepted

Can you get the baseUrl for site by handle or id?

{% set site = craft.app.getSites().getSiteById(1) %} {% set site = craft.app.getSites().getSiteByHandle('handle') %} {{ site.baseUrl }} But I would rather suggest you to grab the entries URL for a ...
user avatar
5 votes
Accepted

How to order Sites

I've seen that before, if you look at the sites table in your DB, you'll see that a few sites might have their sortOrder set to 1. If you go to Settings → Sites → [the offending group] in your ...
user avatar
  • 7,200
4 votes
Accepted

Multi-site setup in Craft3

Have you watched the Craft Hangout? Managing Multiple Sites in Craft 3 – Sites and Localization Might be of use if you haven't. You'll need about an hour free to view it.
user avatar
4 votes

Loop through all sites in multisite installation

Nikolay, As I responded in the slack, I will respond here in case anyone else has this question. In the template you can access this information like so: SiteUrl: {{ siteUrl }} Langauge: {{ craft....
user avatar
4 votes
Accepted

Loop through all sites in multisite installation

If you want to do this purely from a template, then something like this: {% set sites = craft.app.sites.getAllSites() %} {% for site in sites %} <li>{{ site.name }}</li> {% endfor %} ...
user avatar
  • 66.5k
4 votes
Accepted

Craft 3: with Base URL of site set up using @web alias, how to display the original URL in Twig templates?

So luckily for us, Brandon recently added the alias() Twig function. It should show up in Craft CMS 3 RC7. You can see the discussion about it here: https://github.com/craftcms/cms/issues/2327
user avatar
4 votes

Craft 3 language switcher

As of today, Site Switcher is now available in the plugin store! * It was called "Language Link" in Craft 2, but the premise is the same... It allows you to switch between sites while staying on the ...
user avatar
  • 23.6k
4 votes

Craft 3 multi-lingual multi-sites setup with shared assets

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 -...
user avatar
4 votes
Accepted

Craft 3 Multi Language Setup

First of all you should remove all "language" subfolders from your web directory because your web server will route directly in those instead of your default web/index.php. Craft will determinate the ...
user avatar
4 votes

Craft 3 Multi Language Setup

Use aliases, by first defining them in your general.php: 'dev' => [ 'siteUrl' => [ 'default' => 'https://site.test', 'korean' => 'https://site.test/ko', ...
user avatar
  • 83
4 votes

How do I get the primary site URL?

{{ siteUrl }} should do the trick for you.
user avatar
4 votes
Accepted

Can two sites use the same channel, but have unique entries?

There is a light switch field in your section settings with the label "propagate entries across all sites". Just turn it off and your entries will be unique
user avatar
4 votes
Accepted

How to save entry to the current site from the front end?

The parameter is called siteId <input type="hidden" name="siteId" value="{{ currentSite.id }}">
user avatar
4 votes
Accepted

How to route 404 errors for multi-site Craft?

I pondered this for a while, and then did this, which will direct us to specific entries (not templates, I don't want to create more of those): {# We need a unique 404 for each site - just take us to ...
user avatar
  • 608
4 votes
Accepted

Displaying one site's content in another site (Craft 3 Multi-site)

I figured it out! In Section settings > Propagation Method, you must choose 'Save entries to all sites enabled for this section', or, if you're using site groups, choose the appropriate group. This ...
user avatar
  • 608
3 votes
Accepted

Two domains - single install - Live Preview works only on one

In order to get Live Preview to work across different subdomains on a single install, you'll need to setup a few extra things as outlined in this support article: https://craftcms.com/support/cross-...
user avatar
  • 66.5k
3 votes

Can I run one Craft install on multiple domains and/or subdomains?

No you can't. In Craft's early days, they had a MSM-like (ala ExpressionEngine) feature, but they eventually removed because it overcomplicated the system. You will have to run a unique craft install ...
user avatar
  • 79
3 votes
Accepted

Site set up with mutiple sub domains

The approach you described is interesting and should actually work. Separate root folders would allow you to define the template folders individually (→ see Ben's answer on how to set this up), but it ...
user avatar
  • 35.8k
3 votes

Assets, Multi Locale and 'Target Locale'

The "Target Locale" setting under the Asset field's settings is referring to which locale do you want to select assets in. When it's set to "Same as source", then, for example, if you're viewing an ...
user avatar
  • 66.5k

Only top scored, non community-wiki answers of a minimum length are eligible