0

What is wrong with this template code??

{exp:channel:entries channel="featureinfo" limit="1" disable="categories|category_fields|member_data|pagination|trackbacks"}
{sn_header_news}
<div id="mainb">
    <div id="mainc">
        <div id="cimg"><img src="/images/made/images/made/Header-NewsMedia.jpg" alt="Latest News" width="483" height="210" /></div>
        <div id="contbody"><div id="column">
        {sn_newsmedia}
        {embed="index/.colnews"}
        {embed="index/.colpromem"}
            </div>
        <div id="contentc">
        <h1>{title}</h1>
            {if news_image}{exp:ce_img:single src="{news_image}" alt="{title}" width="240" height="160" crop="yes" class="img1"}{/if}
            <h6>Posted: {entry_date format="%l, %j%S %M %Y"}</h6>
            {news_outline}
            </ul>{/if}
            {if news_file}
            <div class="box">
            <h2>Download Related Info</h2>
            <ul>{exp:jco_getfileinfo filename="{news_file}"}
            <li><a href="{news_file}" title="Download {news_filename}" target="_blank">{news_filename}</a> &nbsp; <span style="text-transform:uppercase; font-size:12px; color:#999">({file_extension} - {file_size})</span></li>
            {/exp:jco_getfileinfo}
            </ul>
            </div>{/if}
        </div></div>
    </div>
{sn_footer}
{/exp:channel:entries}

When I view the rendered template i get this error Parse error: syntax error, unexpected 'endif' (T_ENDIF) in /home/coiorg/public_html/splodge/expressionengine/libraries/Functions.php(679) : eval()'d code on line 495

My apologies in advance for being a nuisance!

1 Answer 1

4

Error you are getting is comes only when your {if} statement criteria is not fulfilled. In your case, You have close 1 {/if} without starting any {if} condition. Try this code:

{exp:channel:entries channel="featureinfo" limit="1" disable="categories|category_fields|member_data|pagination|trackbacks"}
{sn_header_news}
<div id="mainb">
    <div id="mainc">
        <div id="cimg">
            <img src="/images/made/images/made/Header-NewsMedia.jpg" alt="Latest News" width="483" height="210" />
        </div>
        <div id="contbody">
            <div id="column">
                {sn_newsmedia}
                {embed="index/.colnews"}
                {embed="index/.colpromem"}
            </div>
            <div id="contentc">
                <h1>{title}</h1>
                {if news_image}{exp:ce_img:single src="{news_image}" alt="{title}" width="240" height="160" crop="yes" class="img1"}{/if}
                <h6>Posted: {entry_date format="%l, %j%S %M %Y"}</h6>
                {news_outline}
                {if news_file}
                <div class="box">
                    <h2>Download Related Info</h2>
                    <ul>
                        {exp:jco_getfileinfo filename="{news_file}"}
                        <li>
                            <a href="{news_file}" title="Download {news_filename}" target="_blank">{news_filename}</a> &nbsp; 
                            <span style="text-transform:uppercase; font-size:12px; color:#999">({file_extension} - {file_size})</span>
                        </li>
                        {/exp:jco_getfileinfo}
                    </ul>
                </div>
                {/if}
            </div>
        </div>
    </div>
</div>
{sn_footer}
{/exp:channel:entries}

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.