[SOLVED] Babel and news article

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Mich-adg
Forum Members
Forum Members
Posts: 199
Joined: Sat Aug 02, 2008 9:08 pm

[SOLVED] Babel and news article

Post by Mich-adg »

Hi all,

i'm looking for a way to display a news article category depending of the lang of the current page. I use Babel for my site.

I tried this at the top of my template :

Code: Select all

{babel action="assign"}
{capture assign=actualang}
{babel show="lang_article"} //babel ml entry
{/capture}
and to display the news but i doesn't work :

Code: Select all

{news number='3' category='$actualang | news'  moretext='...'}
Any idea ?
Thx.
Last edited by Mich-adg on Wed Jan 18, 2012 4:51 pm, edited 1 time in total.
mmarius
New Member
New Member
Posts: 3
Joined: Tue Jun 28, 2011 4:43 pm

Re: Babel and news article

Post by mmarius »

You need to use backticks inside quotes:

Code: Select all

{news number='3' category="`$actualang` | news"  moretext='...'}
Mich-adg
Forum Members
Forum Members
Posts: 199
Joined: Sat Aug 02, 2008 9:08 pm

Re: Babel and news article

Post by Mich-adg »

Tanks for you reply, but this doesn't work for me actually.

But i displayed my $actualang simply in the page, and i discovered that the lang has an empty space after it (ie : fr ) and perhaps that's the problem. Any idea to delete empty character after a string variable in smarty ?
Mich-adg
Forum Members
Forum Members
Posts: 199
Joined: Sat Aug 02, 2008 9:08 pm

[SOLVED ]Babel and news article

Post by Mich-adg »

I tried a different variable and yet it works! Thanks for the backticks tip! The double quotes are important too.

I make this now :

Code: Select all

{news number='1' detailpage='news' category="`$page_lang` | mycat | news" summarytemplate='template' moretext='More...'}
$page_lang is generated by Babel, so i named my first categories "en_EN, fr_FR...". Now i have to change the moretext with a variable string and i got it ;)
Post Reply

Return to “Modules/Add-Ons”