0

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>

1 Answer 1

2

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}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.