--- content_types/node.inc.orig 2007-09-07 11:17:22.000000000 -0400 +++ content_types/node.inc 2007-11-22 05:53:32.000000000 -0500 @@ -12,7 +12,7 @@ function panels_node_panels_content_type /** * Output function for the 'node' content type. Outputs a node - * based on the module and delta supplied in the configuration. + * based on the nid and settings supplied in the configuration. */ function panels_content_node($conf) { $node = node_load($conf['nid']); @@ -20,6 +20,24 @@ function panels_content_node($conf) { return; } + /* this could be optimized to check for translations by nid + * BEFORE the node is loaded above. This is a lot easier though. + * Maybe not a big deal with node caching? + */ + if ($node->translation) { + // i18n_get_lang() gets the language the site is being browsed in + if (array_key_exists(i18n_get_lang(), $node->translation)) { + $lang = i18n_get_lang(); + } else { + // use the default language + $lang = i18n_default_language(); + } + // avoid redundant node load, even if cached + if ($node->language != $lang) { + $node = node_load($node->translation[$lang]->nid); + } + } + if ($conf['suppress_title']) { $node->title = ''; }