Hello,

I'm using i18n for 4.6 multilingual site. I've installed taxonomy_theme to assign different themes for different languages depending on paths. The single path assignment is working fine, like en/about gets the "bluemarine_en" theme as I want.

My problem is that the wild card * doesn't work to assign a theme for an entire language like en/* ! I have to assign every single node, and the dynamically generated content can't get the appropriate theme (i.e. events/2007/07/07 gets the default theme, both under en/ and fr/)!

Is there any work around?

P.S. The site is currently in a subdirectory, but will be moved soon to the root folder.

CommentFileSizeAuthor
#4 d46.png7.95 KBprofix898

Comments

profix898’s picture

Wow. I cant recall how the code was for the 4.6 version of taxonomy_theme. As I'm quite busy atm it may take a day or two to install a test environment and figure out ...

wissam78’s picture

That would be nice...

By the way, the patch:

if (module_exist('i18n')) {
i18n_get_lang_prefix($alias_uri, true);
}

doesn't exist in v.1.6.2.13!

However, it didn't make change when I added it!

Thanx

profix898’s picture

I just tried to install Drupal 4.6 and all I get is a malformed page (see attached screenshot). I guess D4.6 does not work correctly with my recent server configuration (Apache, PHP, MySQL version). But I dont intend to spend more time with a deprecated Drupal version to investigate why it doesnt work.

However you should try to print out the $alias_uri variable and see if it contains the language prefix, e.g. 'en/...'. If neither $uri not $alias_uri are prepended by the prefix there is no easy way for path-based theme switching for your case. You'd need to use a i18n function like i18n_get_lang() (not sure what it was called in 4.6) to get the language then and switch the theme based on that ...

profix898’s picture

StatusFileSize
new7.95 KB

screenie

sally2006’s picture

Component: - Extended (Paths) » Code / API

Hello,

I had this problem in my site too, and it was solved by this change in file : taxonomy_theme_paths

I added this line to source

if (preg_grep($paths_regexp, array($uri, $alias_uri))) {
$custom_theme = $themex->name;
if (module_exists('i18n') && module_invoke('i18n', 'language_rtl'))
$custom_theme = rtl.$themex->name;
}

after that I added a new theme with name " rtlthemename "
now you can use en/* in taxonomy_theme module .

profix898’s picture

Status: Active » Closed (fixed)