New: Learn Statamic on Laracasts!

We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Checking for localized content in multisite setup

Simon Kelly September 17, 2021 by Simon Kelly

Hi there,

I have a multisite setup for two languages (Spanish as origin, English as other). I then have a localizable field to output a heading to a page. I added a conditional check in my template to only output the html if the field has content:

{{ if banner_block_heading }}
<h1>{{ banner_block_heading }}</h1>
{{ /if }}

But I'm seeing that the origin content (Spanish) is output when there is no content in the other language (English). Is there a way to avoid this? Can the conditional check for content only in the current locale?

Many thanks in advance for any help!

Answered by Simon Kelly!
>>>>>>> Answered <<<<<<<
1 Reply
3 Followers