News $lang [SOLVED]
News $lang [SOLVED]
Hi,
Running CMSMSMLE 1.6 with News 2.10, I followed Tips & Tricks #5 to display different news to each language site:
- the 3 categories : en_US, de_DE and fr_FR
- the call in the template : {news category='$lang' number='3' detailpage='news'}
But News don't display the summary articles.
So I tried with other categories like General-en_US, .... with the call like General-$lang, but still no news, with child categories it don't work better. It only works without the $lang, for example with category='en_us'. I read related articles in the forum : other CMSMS users seem to have it working with $lang. Why not me ?
Running CMSMSMLE 1.6 with News 2.10, I followed Tips & Tricks #5 to display different news to each language site:
- the 3 categories : en_US, de_DE and fr_FR
- the call in the template : {news category='$lang' number='3' detailpage='news'}
But News don't display the summary articles.
So I tried with other categories like General-en_US, .... with the call like General-$lang, but still no news, with child categories it don't work better. It only works without the $lang, for example with category='en_us'. I read related articles in the forum : other CMSMS users seem to have it working with $lang. Why not me ?
Last edited by seensite on Wed Jul 22, 2009 1:45 pm, edited 1 time in total.
The universe of information technology is constantly growing and contains only emerging products built on successive patches
Re: News $lang
Try
Code: Select all
{capture assign='temp'}General-{$lang}{/capture}
{news category=$temp number='3' detailpage='news'}
Re: News $lang
Never use ' for variable, use " or better `seensite wrote: - the call in the template : {news category='$lang' number='3' detailpage='news'}
Alby
Re: News $lang
Never use ' for variable, use " or better `
Alby
[/quote]
Hello Alby,
Thanks for replying!
With " there is no news summary and with ` there is a php message instead of news summary :
Warning: Division by zero in /home/www/a11cee77a1b8b951ec7e1b6a39935027/web/modules/News/action.default.php on line 183
Warning: Division by zero in /home/www/a11cee77a1b8b951ec7e1b6a39935027/web/modules/News/action.default.php on line 184
I tried to set number=`1` but the message is the same.
Line 183-184 of default.action.php say :
$pagecount = (int)($count / $pagelimit);
if( ($count % $pagelimit) != 0 ) $pagecount++;
Could I modify something to have it run ?
Best regards
Alby
[/quote]
Hello Alby,
Thanks for replying!
With " there is no news summary and with ` there is a php message instead of news summary :
Warning: Division by zero in /home/www/a11cee77a1b8b951ec7e1b6a39935027/web/modules/News/action.default.php on line 183
Warning: Division by zero in /home/www/a11cee77a1b8b951ec7e1b6a39935027/web/modules/News/action.default.php on line 184
I tried to set number=`1` but the message is the same.
Line 183-184 of default.action.php say :
$pagecount = (int)($count / $pagelimit);
if( ($count % $pagelimit) != 0 ) $pagecount++;
Could I modify something to have it run ?
Best regards
The universe of information technology is constantly growing and contains only emerging products built on successive patches
Re: News $lang
I'll try this, I didn't knew this {capture} tag - thank youPeciura wrote: TryCode: Select all
{capture assign='temp'}General-{$lang}{/capture} {news category=$temp number='3' detailpage='news'}
Edit 1: As I have just 3 categories like en_US, de_DE and fr_FR, I tried with :
{capture assign='temp'}{$lang}{/capture}
{news category=$temp number='3' detailpage='news'}
But I still have the news summary empty.
Edit 2: I tried with
{capture assign=´temp´}{$lang}{/capture}
{news category=$temp number=´3´ detailpage=´news´}
Following Alby's advice and I get the same php error :
Warning: Division by zero in /home/www/a11cee77a1b8b951ec7e1b6a39935027/web/modules/News/action.default.php on line 183
Warning: Division by zero in /home/www/a11cee77a1b8b951ec7e1b6a39935027/web/modules/News/action.default.php on line 184
Last edited by seensite on Tue Jul 21, 2009 9:16 am, edited 1 time in total.
The universe of information technology is constantly growing and contains only emerging products built on successive patches
Re: News $lang
What are exactly your category?
Try to display with your name: category="name_of_category"
After substitute relative category with lang (for example: General-en_US with General-$lang) if General-en_US is your category and en_US is your current lang when display
Alby
Try to display with your name: category="name_of_category"
After substitute relative category with lang (for example: General-en_US with General-$lang) if General-en_US is your category and en_US is your current lang when display
Alby
Re: News $lang
My categories are en_US, de_DE and fr_FR.
When the call contains category="en_US", no problem. When I substitute with $lang, category="$lang" I get the error message.
I tried the code from Blast2007 and it works almost perfect (I have to modify for startperiod and then everything green):
{capture assign='currentdate'}{current_date format="%F" }{/capture}
{CGFeedMaker action='rsslink' feed='fr_FR,de_DE,en_US' text=' ' image='/images/cms/RSS_feed.png'}
Informations
{news category="en_US,de_DE,fr_FR" sortasc="true" number="3" summarytemplate="optimized_summary" detailtemplate="optimized_details"}
But... with $lang parameter in Blast2007 code, nohope. I don't understand why in that case nothing is display in the summary field.
When the call contains category="en_US", no problem. When I substitute with $lang, category="$lang" I get the error message.
I tried the code from Blast2007 and it works almost perfect (I have to modify for startperiod and then everything green):
{capture assign='currentdate'}{current_date format="%F" }{/capture}
{CGFeedMaker action='rsslink' feed='fr_FR,de_DE,en_US' text=' ' image='/images/cms/RSS_feed.png'}
Informations
{news category="en_US,de_DE,fr_FR" sortasc="true" number="3" summarytemplate="optimized_summary" detailtemplate="optimized_details"}
But... with $lang parameter in Blast2007 code, nohope. I don't understand why in that case nothing is display in the summary field.
The universe of information technology is constantly growing and contains only emerging products built on successive patches
Re: News $lang
Do you have anything in the summary of these news items?...
Re: News $lang
? Yes, each article has a small summary.Dr. CSS wrote: Do you have anything in the summary of these news items?...
The universe of information technology is constantly growing and contains only emerging products built on successive patches
Re: News $lang
If works
your current language is "en_US"
category "en_US" is filled with not empty news
and doesn't work
In my opinion $lang is not equal to "en_US"
try to debug it:
create UDT "var_dump"
use it {var_dump var=$lang} and you will see details of variable "$lang"
Code: Select all
category="en_US"
your current language is "en_US"
category "en_US" is filled with not empty news
and doesn't work
Code: Select all
category="$lang"
try to debug it:
create UDT "var_dump"
Code: Select all
if (!empty($params['var'])){
echo '<pre>';
var_dump($params['var']);
echo '</pre>';
}
Re: News $lang
Hello Pecuria,
The UDT returns : string(3) "usa" (when in the english pages of the site)
The UDT returns : string(3) "deu" (when in the german pages of the site)
The UDT returns : string(3) "fra" (when in the french pages of the site)
This seems to have been defined in "MLE Languages" in the Admin.
The UDT returns : string(3) "usa" (when in the english pages of the site)
The UDT returns : string(3) "deu" (when in the german pages of the site)
The UDT returns : string(3) "fra" (when in the french pages of the site)
This seems to have been defined in "MLE Languages" in the Admin.
The universe of information technology is constantly growing and contains only emerging products built on successive patches
Re: News $lang
That's it! Pecuria your opinion is right : following the tuto for mle 1.6 I set up deu, usa and fra where I should have entered de_DE, en_US and fr_FR... I made this wrong because the website'folder "is not writable from php!" and I edited config_lang.php by hand and not by wysiwyg in the admin section. It is a host on which I can't change this php setting : sad.
Thank you for pointing this to me!
Best regards
Thank you for pointing this to me!
Best regards
The universe of information technology is constantly growing and contains only emerging products built on successive patches