• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Show News articles in default language when empty
PostPosted: Tue Aug 31, 2010 11:18 pm 
Offline
Forum Members
Forum Members

Joined: Wed Apr 23, 2008 11:19 am
Posts: 64
I have three languages.

In my template I call the newsmodule as follows:

{news category="Partners-$lang" summarytemplate="Partners" sortasc="true" }

Not all my languages have translations of the news articles.

How can I show the news articles in the default language when there is no translation in that language ?

I was thinking about the following UDT:

Code:
global $gCms;
$smarty =& $gCms->GetSmarty();
$lang = $smarty->get_template_vars('lang');

  if ($lang == 'nl_NL'){   
      echo 'nl_NL';
  } elseif ($lang == 'en_US')  {
       echo 'en_US';
  }  else  {
       echo 'en_US';
  }


But How to correctly use the UDT in stead of the $lang part:

{news category="Partners-$lang" summarytemplate="Partners" sortasc="true" }

?


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Show News articles in default language when empty
PostPosted: Wed Sep 01, 2010 3:39 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4809
Location: Ferrara, Italy
Dutch_guy wrote:
But How to correctly use the UDT in stead of the $lang part:


Humm, why UDT...
I think with (in 1.8.2):

Code:
{capture assign="news_language"}{news category="Partners-$lang" summarytemplate="Partners" sortasc="true"}{/capture}
{if $itemcount > 0}{$news_language}
{else}{news category="Partners-$lang_default" summarytemplate="Partners" sortasc="true"}{/if}


Alby

_________________
Former Italian Admin and Moderator
Multilingual: MLE is not CMSMS


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Show News articles in default language when empty
PostPosted: Wed Sep 01, 2010 6:17 pm 
Offline
Forum Members
Forum Members

Joined: Wed Apr 23, 2008 11:19 am
Posts: 64
Works !

Thanks !

Do you have any more info on the "capture" code ?


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Show News articles in default language when empty
PostPosted: Thu Sep 02, 2010 9:17 am 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4809
Location: Ferrara, Italy
Dutch_guy wrote:
Do you have any more info on the "capture" code ?


http://www.smarty.net/manual/en/languag ... on.capture

Alby

_________________
Former Italian Admin and Moderator
Multilingual: MLE is not CMSMS


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosting Nation - Managed CMSMS Hosting