Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front page to be configurable by language #3500

Open
mazzech opened this issue Jan 25, 2019 · 5 comments
Open

Front page to be configurable by language #3500

mazzech opened this issue Jan 25, 2019 · 5 comments

Comments

@mazzech
Copy link

mazzech commented Jan 25, 2019

Backdrop CMS does not support the default front page setting to be multilingual (one node for each language). Drupal 7 core does not either, but the contrib module i18n does. This feature would be helpful for Backdrop adoption in multilingual environments

However, there's a small workaround, using the redirect function in node settings. Just add a redirection to the default front page, pointing to the intended 2nd language front page node, and make this redirection language aware (2nd language).

@klonos
Copy link
Member

klonos commented Jan 25, 2019

Thanks for filing this issue here @mazzech, and for figuring out the workaround using redirects 👍

Something to note here for posterity is that multiple redirects would need to be created if the site is using more than one language (one redirect for each language).

Also for posterity, I am copying here the other workarounds suggested over the recent discussion on Gitter, as these might work better in other use cases:

How do I link to the front page in a template (click on logo)...? <a href="<?php print $front_page; ?>"> does not work, HTML output is href=""

try l('My Text', '<front>');
If the link isn't just text and has HTML you can do something like : <?php l( '<img src="..." alt="'. t('Home'); . '" >', '<front>', array( 'html' => true, ) ); ?>
see: https://api.backdropcms.org/api/backdrop/core%21includes%21common.inc/function/l/1

@klonos
Copy link
Member

klonos commented Jan 25, 2019

...also noting that this (empty href="" when printing $front_page) sounds more like a bug.

@klonos
Copy link
Member

klonos commented Jan 26, 2019

I cross-referenced some older issues here which could be related/duplicates.

#1638
#1637

@quicksketch
Copy link
Member

In a way this is already possible. Backdrop includes an out-of-box "home" layout at /home, and sets the homepage to this path.

You can then set up a different layout (one for each language) all at the path /home, with a condition on each one for the site language. Then you would achieve having a different homepage per language, though they would all be at the same internal path of /home. Accessing each one would be through /en/home, /es/home, /fr/home, etc.

@indigoxela
Copy link
Member

In case someone needs it - there's a module for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants