Jump to content

1.6 is it possible to have different theme for different lang?


Recommended Posts

for example, using the default theme for eng,

but when switching to a different lang (say Hebrew) have a different theme

(that is more RTL aware, maybe even a customized copy of the default).

 

1) is it possible to do it base on specific lang?

 

2) is it possible to do it base on some condition?

  - switch theme based on 'is it RTL language'

  - switch theme base on user logged in group, (customer, supplier, partner, etc...)

  - base on user choice?

 - ... base on whatever condition (mobile theme, whatever)

 

so instead of creating and maintaining one monster multilingual multipurpose responsive theme,

at least while developing the themes, i can spread the work to different themes, and (optionaly) consolidate them only when they are done?

 

Link to comment
Share on other sites

i think that it's possible (i hope so, i never tested it)

you can try to deal with config.inc.php file (from config directory)

 

there is a code like:
 

try 
{
	$context->shop = Shop::initialize();
	$context->theme = new Theme((int)$context->shop->id_theme);
	if ((Tools::isEmpty($theme_name = $context->shop->getTheme()) || !Validate::isLoadedObject($context->theme)) && !defined('_PS_ADMIN_DIR_'))
		throw new PrestaShopException(Tools::displayError('Current theme unselected. Please check your theme configuration.'));
}
catch (PrestaShopException $e)
{
	$e->displayMessage();
}
define('_THEME_NAME_', $theme_name);
define('__PS_BASE_URI__', $context->shop->getBaseURI());
Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...