0

I get an error message each time. "You have an invalid conditional in your template. Please review your conditionals for an unclosed string, invalid operators, a missing }, or a missing {/if}." Stuck not sure what to do.

  {exp:channel:entries channel="{segment_1}"}
     {if banner}
     <img src="{banner}" alt="photo:{title}" class="margin-top-minus-20 img-responsive osd-border" />
     {/exp:channel:entries}
     {if:else}
      <!-- snippet-->
     {snp-banner-grid}{/if}

2 Answers 2

0
{exp:channel:entries channel="{segment_1}"}
     {if banner}
        <img src="{banner}" alt="photo:{title}" class="margin-top-minus-20 img-responsive osd-border" />
     {if:else}
        {snp-banner-grid}
     {/if}
{/exp:channel:entries}
2

You cannot close your exp:channel:entries-tag in a branch of the if-structure, because in case you have a banner (first branch) you finish the channel-loop and will not get to the end of the if-construct. Vice versa if you do not have a banner you will not end the channel-loop.

Therefore put the closing {/exp:channel:entries} after the very end of your code snippet and it will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.