News $lang [SOLVED]

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
seensite
Forum Members
Forum Members
Posts: 173
Joined: Sun Feb 10, 2008 7:36 pm

News $lang [SOLVED]

Post 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 ?
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
Peciura

Re: News $lang

Post by Peciura »

Try

Code: Select all

{capture assign='temp'}General-{$lang}{/capture}
{news category=$temp number='3' detailpage='news'}
alby

Re: News $lang

Post by alby »

seensite wrote: - the call in the template : {news category='$lang' number='3' detailpage='news'}
Never use ' for variable, use " or better `

Alby
User avatar
seensite
Forum Members
Forum Members
Posts: 173
Joined: Sun Feb 10, 2008 7:36 pm

Re: News $lang

Post 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
The universe of information technology is constantly growing and contains only emerging products built on successive patches
User avatar
seensite
Forum Members
Forum Members
Posts: 173
Joined: Sun Feb 10, 2008 7:36 pm

Re: News $lang

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

Re: News $lang

Post 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
User avatar
seensite
Forum Members
Forum Members
Posts: 173
Joined: Sun Feb 10, 2008 7:36 pm

Re: News $lang

Post 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.
The universe of information technology is constantly growing and contains only emerging products built on successive patches
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: News $lang

Post by Dr.CSS »

Do you have anything in the summary of these news items?...
User avatar
seensite
Forum Members
Forum Members
Posts: 173
Joined: Sun Feb 10, 2008 7:36 pm

Re: News $lang

Post by seensite »

Dr. CSS wrote: Do you have anything in the summary of these news items?...
? Yes, each article has a small summary.
The universe of information technology is constantly growing and contains only emerging products built on successive patches
Peciura

Re: News $lang

Post by Peciura »

If  works

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"
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"
User avatar
seensite
Forum Members
Forum Members
Posts: 173
Joined: Sun Feb 10, 2008 7:36 pm

Re: News $lang

Post 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.
The universe of information technology is constantly growing and contains only emerging products built on successive patches
User avatar
seensite
Forum Members
Forum Members
Posts: 173
Joined: Sun Feb 10, 2008 7:36 pm

Re: News $lang

Post 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
The universe of information technology is constantly growing and contains only emerging products built on successive patches
Locked

Return to “[locked] CMSMS MLE fork”