Hello,
After the topic I want to display "default language" page if current language page is not ready (empty content)
is it possible to automaticaly display a personalized message (with html) before the {content} tag if a page isn't translated?
Like : This page has not yet been translated into your language navigation. We apologize for the inconvenience...
Thank you & excuse my English, i'm french.
Display a message before an untranslated page
Re: Display a message before an untranslated page
In newer version you must browse "manually" for retrieve language page not readywill83 wrote: After the topic I want to display "default language" page if current language page is not ready (empty content)
is it possible to automaticaly display a personalized message (with html) before the {content} tag if a page isn't translated?
Alby
Re: Display a message before an untranslated page
Excuse me, I forgot details.
I use the latest version of MLE, and my untranslated pages contain the contents of the other language.
This would be interesting would be to display a message above the content untranslated (just to inform the user that if he sees his page in French it is not a mistake, but just an untranslated)
I use the latest version of MLE, and my untranslated pages contain the contents of the other language.
This would be interesting would be to display a message above the content untranslated (just to inform the user that if he sees his page in French it is not a mistake, but just an untranslated)
Re: Display a message before an untranslated page
In function.content.php, try to add:will83 wrote: Excuse me, I forgot details.
I use the latest version of MLE, and my untranslated pages contain the contents of the other language.
This would be interesting would be to display a message above the content untranslated (just to inform the user that if he sees his page in French it is not a mistake, but just an untranslated)
report if work//Start MLE
global $hls, $hl, $mleblock, $mleblockfallback;
$result = $smarty->fetch(str_replace(' ', '_', 'content:'.(isset($params['block']) ? "{$params['block']}{$mleblock}" : 'content_en')), '', $pageinfo->content_id.'-'.$hl);
if(empty($result) && !empty($mleblockfallback))
{
$def_lang = DEFAULT_LANG;
$result = $smarty->fetch(str_replace(' ', '_', 'content:'.(isset($params['block']) ? "{$params['block']}_{$hls[$def_lang]['block']}" : "content_{$hls[$def_lang]['block']}")), '', "{$pageinfo->content_id}-{$def_lang}");
$result = 'This page has not yet been translated into your language navigation. We apologize for the inconvenience... '. $result;
}
//End MLE
Alby
Re: Display a message before an untranslated page
Thank you, but it does not work on the untranslated pages that display the default language.
But this code displays the message, but on every page:
But this code displays the message, but on every page:
// Start MLE
global $hls, $hl, $mleblock, $mleblockfallback;
$result = $smarty->fetch(str_replace(' ', '_', 'content:'.(isset($params['block']) ? "{$params['block']}{$mleblock}" : 'content_en')), '', $pageinfo->content_id.'-'.$hl);
$result = 'This page has not yet been translated into your language navigation. We apologize for the inconvenience... '. $result;
if (empty($result) && !empty($mleblockfallback))
{
$def_lang = DEFAULT_LANG;
$result = $smarty->fetch(str_replace(' ', '_', 'content:'.(isset($params['block']) ? "{$params['block']}_{$hls[$def_lang]['block']}" : "content_{$hls[$def_lang]['block']}")), '', "{$pageinfo->content_id}-{$def_lang}");
}
// End MLE
Re: Display a message before an untranslated page
Yes, this is a broke code and disply message in empty page also ....will83 wrote: Thank you, but it does not work on the untranslated pages that display the default language.
But this code displays the message, but on every page:
Use my code and enable DEFAUL LANG FALLBACK in Global settings
Alby
Re: Display a message before an untranslated page
DEFAUL LANG FALLBACK in Global settings is enabled.
I have exactly replace the original code by this one, but the code don't work.
Does this code work for you?
Thank you for your help!
I have exactly replace the original code by this one, but the code don't work.
Does this code work for you?
Thank you for your help!
Re: Display a message before an untranslated page
No, it was UNTESTEDwill83 wrote: Does this code work for you?
Tomorrow I try
Alby
Re: Display a message before an untranslated page
Yes, not workalby wrote: Tomorrow I try
Alby