joe_ma Posted April 1, 2014 Share Posted April 1, 2014 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 More sharing options...
Martijn Geerts Posted April 1, 2014 Share Posted April 1, 2014 You could use strlen() I think Link to comment Share on other sites More sharing options...
Fokke Posted April 1, 2014 Share Posted April 1, 2014 Hi! In field settings there's a setting called "Language support / Blank behavior". Set it to "Remain blank". 3 Link to comment Share on other sites More sharing options...
joe_ma Posted April 1, 2014 Author Share Posted April 1, 2014 Oh, as simple as that Thanks Fokke. There is always a surprisingly easy way with PW. Great! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now