Cms page locale
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Cms page locale
Php: 8.2.10
Laravel: 10.24.0
Aimeos-laravel: 2023.07.1
Hello,
It is about the demo-homepage route that we can see in the CMS in the panel admin is /, so when i changed SHOP_MULTILOCALE to "true", the root path of the website is redirected to "/{locale}", but the content of the demo-homepage is not rendered, it also seems that "/{locale}/p/{path?}" route work only if "path" is not null.
How to configure the aimeos routes "/{locale}" to render demo-homepage ?
Thank you in advance for your attention
Laravel: 10.24.0
Aimeos-laravel: 2023.07.1
Hello,
It is about the demo-homepage route that we can see in the CMS in the panel admin is /, so when i changed SHOP_MULTILOCALE to "true", the root path of the website is redirected to "/{locale}", but the content of the demo-homepage is not rendered, it also seems that "/{locale}/p/{path?}" route work only if "path" is not null.
How to configure the aimeos routes "/{locale}" to render demo-homepage ?
Thank you in advance for your attention
Re: Cms page locale
Change the URL of the page in the CMS panel from "/" e.g. to "/en/"
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Cms page locale
Thank you for the answer,
but if i do that, it only work when locale = en, it still not work when locale = de for exemple.
but if i do that, it only work when locale = en, it still not work when locale = de for exemple.
Re: Cms page locale
CMS page module use two variables to determine the page to be shown:
- the {path} URL segment if available
- the full path if the {path} URL segment isn't available
See: https://github.com/aimeos/ai-cms-grapes ... d.php#L306
If you want to use the {path} URL segment, check your routes if they match with your URLs using:
- the {path} URL segment if available
- the full path if the {path} URL segment isn't available
See: https://github.com/aimeos/ai-cms-grapes ... d.php#L306
If you want to use the {path} URL segment, check your routes if they match with your URLs using:
Code: Select all
php artian route:list
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Cms page locale
From your answer, i think it was just the right starting point to fix the problem i had!
I added this to my routes, so only the route "/" has {locale?} (because changing aimeos_home prefix in shop.php changed a lot of others routes)
if( ( $conf = config( 'shop.routes.home', ['middleware' => ['web']] ) ) !== false ) {
Route::match( array( 'GET', 'POST' ), '/', array(
'as' => 'aimeos_home',
'uses' => 'Aimeos\Shop\Controller\CatalogController@homeAction'
) )->where( ['locale?' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] );
Route::group( $conf, function() {
Route::match( array( 'GET', 'POST' ), '/', array(
'as' => 'aimeos_home',
'uses' => 'Aimeos\Shop\Controller\CatalogController@homeAction'
) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] );
});
}
Transferred SetLocale middleware in web middleware,
...
app()->setLocale($locale);
$request->merge([ 'locale' => $locale]);
It seems to work like a charm
Thank you again!
I added this to my routes, so only the route "/" has {locale?} (because changing aimeos_home prefix in shop.php changed a lot of others routes)
if( ( $conf = config( 'shop.routes.home', ['middleware' => ['web']] ) ) !== false ) {
Route::match( array( 'GET', 'POST' ), '/', array(
'as' => 'aimeos_home',
'uses' => 'Aimeos\Shop\Controller\CatalogController@homeAction'
) )->where( ['locale?' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] );
Route::group( $conf, function() {
Route::match( array( 'GET', 'POST' ), '/', array(
'as' => 'aimeos_home',
'uses' => 'Aimeos\Shop\Controller\CatalogController@homeAction'
) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] );
});
}
Transferred SetLocale middleware in web middleware,
...
app()->setLocale($locale);
$request->merge([ 'locale' => $locale]);
It seems to work like a charm
Thank you again!
Re: Cms page locale
The correct setup for the home page in multi-site setups is described here:
https://aimeos.org/docs/latest/laravel/ ... /#homepage
https://aimeos.org/docs/latest/laravel/ ... /#homepage
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Cms page locale
Shall i edit the topic and write [SOLVED] ? Sorry i have almost never asked for help on a forum before.
Re: Cms page locale
No, it's OK
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star