Is there any way to provide a different node ID per language for the front page setting in Drupal 8?
We need a different front page for a specific language. In Drupal 7, this was easy.
Technically, the config override API that config translation uses allows any kind of override of configuration.
The core config translation however only does translation, meaning it only allows to change things that are classified as user-facing texts and not technical strings.
What you want is usually referred to as localization, changing things based the language that isn't actually a "translation". There is a core issue to better support this, https://www.drupal.org/node/2275865, but it hasn't been updated in quite some time.
There are a few possible workarounds, though:
Since you mention nodes, in Drupal 8, translations of nodes have the same ID/URL. That means you could have your different front pages as translations of the same node. That would be problematic if you use Paragraphs for example, as that doesn't currently support translatable fields, so you'd be forced into the same structure.
You could use Page Manager to have different front pages (there is a per-language constraint necessary, which has a patch but has not yet been committed) or even just a view that selects a node based on a certain condition (like filtered by language of a certain type).
A custom callback that displays a certain node based on a bit of code.
Update:
4 years later, I had this use case too and still no activity on the core issue. As a workaround, I altered the config schema and made the front_page a label type to be able to translate it. Not fully tested yet, so beware of dragons:
function custom_config_schema_info_alter(&$definitions) {
// Change the front page type to label so that it can be translated.
$definitions['system.site']['mapping']['page']['mapping']['front']['type'] = 'label';
}
Another way to have a homepage per language, or just about any config override per language is to use config override system. I created a ticket in config_override module to add language overrides support and there is a patch attached: https://www.drupal.org/node/2914987
In short, you would be able to create a folder in your codebase with language overrides, where each language will have it's own subfolder and config override will merge config keys from language overrides with the active configuration.
Example of usage: Include language_override config key in settings.php
$config_directories['language_override'] = '../config_override/language';
Place an override file in 'language_override' folder following core's config_translation structure: [language_override]/en/system.site.yml
page:
front: /node/123
The patch is in review, but you could install the module and apply the patch easily to get this feature.
Make a view that provides a block for each language. Master has no output, Content: ID (< 1).
For Language set Rendering Language: Content language of view row (default).
If you want to display a full node on some language's front page, use Format -> Show: Content | Full content, and for Filter criteria use Content: ID (= 123).
Create a node with no content. Make this node your front page in Basic Site Settings -> Default front page. Translate this node for all languages.
Place the blocks at Content region, no title, configure them with language restriction and with Pages restriction, show only on the node you set as your front page.
If you are displaying a full node on one some blocks, include the title in block configuration. The title being shown then is not the node title, but the block title. This will be h2, that needs to be styled like h1.
This is trickier than I remembered, but possible.