Page 1 of 1
News $lang [SOLVED]
Posted: Mon Jul 20, 2009 11:14 am
by seensite
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 ?
Re: News $lang
Posted: Mon Jul 20, 2009 12:21 pm
by Peciura
Try
Code: Select all
{capture assign='temp'}General-{$lang}{/capture}
{news category=$temp number='3' detailpage='news'}
Re: News $lang
Posted: Mon Jul 20, 2009 1:15 pm
by alby
seensite wrote:
- the call in the template : {news category='$lang' number='3' detailpage='news'}
Never use
' for variable, use
" or better
`
Alby
Re: News $lang
Posted: Tue Jul 21, 2009 6:09 am
by seensite
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
Re: News $lang
Posted: Tue Jul 21, 2009 6:11 am
by seensite
Peciura wrote:
Try
Code: Select all
{capture assign='temp'}General-{$lang}{/capture}
{news category=$temp number='3' detailpage='news'}
I'll try this, I didn't knew this {capture} tag - thank you
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
Re: News $lang
Posted: Tue Jul 21, 2009 1:27 pm
by alby
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
Re: News $lang
Posted: Tue Jul 21, 2009 2:16 pm
by seensite
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.
Re: News $lang
Posted: Tue Jul 21, 2009 7:07 pm
by Dr.CSS
Do you have anything in the summary of these news items?...
Re: News $lang
Posted: Wed Jul 22, 2009 6:18 am
by seensite
Dr. CSS wrote:
Do you have anything in the summary of these news items?...
? Yes, each article has a small summary.
Re: News $lang
Posted: Wed Jul 22, 2009 10:21 am
by Peciura
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"
Code: Select all
if (!empty($params['var'])){
echo '<pre>';
var_dump($params['var']);
echo '</pre>';
}
use it {var_dump var=$lang} and you will see details of variable "$lang"
Re: News $lang
Posted: Wed Jul 22, 2009 12:32 pm
by seensite
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.
Re: News $lang
Posted: Wed Jul 22, 2009 1:36 pm
by seensite
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