Display a message before an untranslated page

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
User avatar
will83
Forum Members
Forum Members
Posts: 88
Joined: Sat Aug 02, 2008 6:23 pm

Display a message before an untranslated page

Post by will83 »

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.
alby

Re: Display a message before an untranslated page

Post by alby »

will83 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?
In newer version you must browse "manually" for retrieve language page not ready

Alby
User avatar
will83
Forum Members
Forum Members
Posts: 88
Joined: Sat Aug 02, 2008 6:23 pm

Re: Display a message before an untranslated page

Post by will83 »

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)
alby

Re: Display a message before an untranslated page

Post by alby »

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)
In function.content.php, try to add:
//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
report if work
Alby
User avatar
will83
Forum Members
Forum Members
Posts: 88
Joined: Sat Aug 02, 2008 6:23 pm

Re: Display a message before an untranslated page

Post by will83 »

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:
// 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
alby

Re: Display a message before an untranslated page

Post by alby »

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:
Yes, this is a broke code and disply message in empty page also ....
Use my code and enable DEFAUL LANG FALLBACK in Global settings

Alby
User avatar
will83
Forum Members
Forum Members
Posts: 88
Joined: Sat Aug 02, 2008 6:23 pm

Re: Display a message before an untranslated page

Post by will83 »

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!
alby

Re: Display a message before an untranslated page

Post by alby »

will83 wrote: Does this code work for you?
No, it was UNTESTED
Tomorrow I try

Alby
alby

Re: Display a message before an untranslated page

Post by alby »

alby wrote: Tomorrow I try
Yes, not work

Alby
Locked

Return to “[locked] CMSMS MLE fork”