Jump to content

Empty field in one language displays default language


joe_ma
 Share

Recommended Posts

Hello

I am working on a multi-language site, where I have news articles that have fields for lead and body.

Now, when the lead field of one language is empty, the template takes the text from the default language.

I should rather like the template to display nothing at all.

My code:

		foreach ($news as $n) {
			
		if ($n->lead) {
		echo "<p><strong>{$n->lead}</strong></p>";}
		echo "{$n->body}";
		
		
		}

Obviously the if statement is not looking in the active language only. So how do I tell it to do so?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...