Reputation: 1523
I am getting this syntax error, though it all seems ok.
{/if}" unclosed {else} tag
This is the code in a .tpl file. If a take out the foreach loop the code compiles fine.
Please advise.
<div >
{if $ct_messages == 0}
<h4 class="account_notice">
Aucun message dans votre boîte de réception.
</h4>
{else}
<button class="btn check_all" type="button" value="0" > Tout sélectionner</button>
<div class="message_options">
<button id="message_delete" class="btn btn_box" type="button" > Supprimer </button>
</div>
<form action="" name="delete_message" method="post" id="delete_message" >
<table>
{foreach $messages as $message}
<tr>
<td class="hide_id"> { $message['message_id']} </td>
<td class="mess_info1" ><input type="checkbox" name="message_id[]" value= "{$message['message_id']}" ></td>
<td {if isset($message['opened'])} class="not_read" {else} class="read" > {$message['subject']} </td>
<td {if isset($message['opened'])} class="not_read" {else} class="read"> {$message['time_sent']} </td>
</tr>
{/foreach}
</table>
</form>
{/if}
</div>
Upvotes: 0
Views: 740
Reputation: 1112
You are actually missing two {/if}
closing tags. This is how it should look like in both instances:
{if isset($message['opened'])} class="not_read" {else} class="read" {/if}
Upvotes: 2