Jump to content

Recommended Posts

Posted

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?

Posted

Hi!

In field settings there's a setting called "Language support / Blank behavior". Set it to "Remain blank".

  • Like 3
Posted

Oh, as simple as that :-[

Thanks Fokke.

There is always a surprisingly easy way with PW. Great!

  • Like 1

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
  • Recently Browsing   0 members

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