Too many if/else's breaks page? (v2)

I'm building a webpage with two languages. The page contains a couple of instances of collections that are filtered by specific fields, like so:

{{ collection:mycollection }}
{{ if field01 == 'option01' and field02 == 'option01'
...
{{ /if }}
{{ /collection:mycollection }}
...
...
...
{{ collection:mycollection }}
{{ if field01 == 'option01' and field02 == 'option02'
...
{{ /if }}
{{ /collection:mycollection }}

Nothing too complicated. The page doesn't contain an extreme amount of text, but all text is hard coded in the template (because we're not going to use the control panel or yaml files) like so:

<p>{{ if locale == 'en' }}This is the English text{{ else }}This is the other language's text{{ /if }}</p>
<ul>
  <li>{{ if locale == 'en' }}English list-item 01{{ else }}Other language list-item 01{{ /if }}</li>
  <li>{{ if locale == 'en' }}English list-item 02{{ else }}Other language list-item 02{{ /if }}</li>
  <li>{{ if locale == 'en' }}English list-item 03{{ else }}Other language list-item 03{{ /if }}</li>
</ul>

Now, on to the problem at hand.

I literally copy-pasted that whole {{ if locale == 'en' }}English{{ else }}Other{{ /if }} part, apparently one too many times, because at one point my collection entries just completely disappeared. I figured this out because I just kept CMD-Z'ing till everything worked again and the only thing that I've changed that broke my page (i.e. stopped the collections from being displayed) was adding another {{ if locale ...}} {{ else }} {{ /if }}.

Is this a memory limit issue? Is there just so many if/else's a webpage can take? I'm running a local environment on Laravel Valet.

Answered by Erin Dalzell!
>>>>>>> Answered <<<<<<<
2 Replies
2 Followers