ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Baffling template behavior

August 06, 2010 6:20pm

Subscribe [2]
  • #1 / Aug 06, 2010 6:20pm

    Jason Morehead

    456 posts

    This may very well be a case of me staring so long at the code that I can’t see the error in front of me, but here goes. I’ve got a template renders just fine—except for the core weblog entries tag that loads most of the content. I did some digging, and narrowed it down to a couple of potential culprits. Here’s the relevant code:

    {exp:weblog:entries weblog="feature_films" url_title="{segment_2}" dynamic="off"}
    
    <!-- BEGIN page title -->
    <h2 id="page_title">{title}</h2>
    <!-- END page title -->
    
    <!-- BEGIN page content -->
    
    {if feature_credits != ""}
        <h4>{feature_credits}</h4>
    <p>{/if}</p>
    
    <p>{if feature_masthead1 != "" OR feature_masthead2 != "" OR feature_masthead3 != ""}</p>
    
    <p>    <div class="image_tiles"><br />
        <br />
            {if feature_masthead1 != ""}<br />
                {exp:imgsizer:size src="{feature_masthead1}" width="166" height="156" alt=""}<br />
            {/if}<br />
            <br />
            {if feature_masthead2 != ""}<br />
                {exp:imgsizer:size src="{feature_masthead2}" width="166" height="156" alt=""}<br />
            {/if}<br />
            <br />
            {if feature_masthead3 != ""}<br />
                {exp:imgsizer:size src="{feature_masthead3}" width="166" height="156" alt=""}<br />
            {/if}<br />
        <br />
        </div></p>
    
    <p>{/if}</p>
    
    <p><br />
    {feature_premiere_status} Theatrical Premiere, One Screening Only</p>
    
    <p>{feature_price_info}</p>
    
    <p><br />
    <ul class="feature_buttons"><br />
        <li class="buy_tickets"><a href="/2010/buy-tickets/">Buy Tickets</a></li><br />
    </ul></p>
    
    <p>{if feature_short_desc != ""}<br />
        <h3 class="alt2">Short Description</h3><br />
        {feature_short_desc}<br />
    {/if}</p>
    
    <p>{if feature_buzz != ""}<br />
        <h3 class="alt2">The Buzz</h3><br />
        <div class="the_buzz">{feature_buzz}</div><br />
    {/if}</p>
    
    <p>{if feature_synopsis != ""}<br />
        <h3 class="alt2">Synopsis</h3><br />
        {feature_synopsis}<br />
    {/if}</p>
    
    <p>{if feature_co_presenter != ""}<br />
        <h3 class="alt2">Co-Presenter</h3><br />
        {feature_co_presenter}<br />
    {/if}</p>
    
    <p>{if feature_canadian_short != ""}<br />
        <h3 class="alt2">Screens With Canadian Short Film</h3><br />
        {feature_canadian_short}. See <a href="/2010/canada-after-dark">Canada After Dark</a> for details.<br />
    {/if}</p>
    
    <p>{if feature_trailer1_name != "" && feature_trailer1_embed != ""}<br />
        </p><h3>{feature_trailer1_name}</h3>
    <p>    <div class="trailer_feature">{feature_trailer1_embed}</div><br />
    {/if}</p>
    
    <p>{if feature_trailer2_name != "" && feature_trailer2_embed != ""}<br />
        </p><h3>{feature_trailer2_name}</h3>
    <p>    <div class="trailer_feature">{feature_trailer2_embed}</div><br />
    {/if}</p>
    
    <p>{if feature_poster1_name != "" && feature_poster1_image != ""}</p>
    
    <p>    </p><h3>{feature_poster1_name}</h3>
    <p>    <br />
        {if feature_poster1_image != ""}<br />
            {exp:imgsizer:size src="{feature_poster1_image}" width="460" alt=""}<br />
        {/if}</p>
    
    <p>{/if}</p>
    
    <p>{if feature_poster2_name != "" && feature_poster2_image != ""}</p>
    
    <p>    </p><h3>{feature_poster2_name}</h3>
    
    <p>    {if feature_poster2_image != ""}<br />
            {exp:imgsizer:size src="{feature_poster2_image}" width="460" alt=""}<br />
        {/if}</p>
    
    <p>{/if}</p>
    
    <p>{!--</p>
    
    <p>{if feature_still1_title != "" && feature_still1_image != ""}</p>
    
    <p>    </p><h3>{feature_still1_title}</h3>
    <p>    <br />
        {if feature_still1_image != ""}<br />
            {exp:imgsizer:size src="{feature_still1_image}" width="460" alt=""}<br />
        {/if}</p>
    
    <p>{/if}</p>
    
    <p>{if feature_still2_title != "" && feature_still2_image != ""}</p>
    
    <p>    </p><h3>{feature_still2_title}</h3>
    <p>    <br />
        {if feature_still2_image != ""}<br />
            {exp:imgsizer:size src="{feature_still2_image}" width="460" alt=""}<br />
        {/if}</p>
    
    <p>{/if}</p>
    
    <p>{if feature_url_official != "" || feature_url_facebook != "" || <br />
        feature_url_myspace != "" || feature_url_twitter != "" || <br />
        feature_url_imdb != "" || feature_url_imdb_pro != "" || <br />
        feature_url_wikipedia != "" || feature_url_other_title != "" || <br />
        feature_url_other != ""}</p>
    
    <p>    </p><h3>Other Links For This Film</h3>
    
    <p>    <ul></p>
    
    <p>        {if feature_url_official != ""}<br />
                <li><a href="http://{exp:extract_url}{feature_url_official}{/exp:extract_url}">Official Site</a></li><br />
            {/if}<br />
            {if feature_url_facebook != ""}<br />
                <li><a href="http://{exp:extract_url}{feature_url_facebook}{/exp:extract_url}">Facebook Page</a></li><br />
            {/if}<br />
            {if feature_url_myspace != ""}<br />
                <li><a href="http://{exp:extract_url}{feature_url_myspace}{/exp:extract_url}">MySpace</a></li><br />
            {/if}<br />
            {if feature_url_twitter != ""}<br />
                <li><a href="http://{exp:extract_url}{feature_url_twitter}{/exp:extract_url}">Twitter</a></li><br />
            {/if}<br />
            {if feature_url_imdb != ""}<br />
                <li><a href="http://{exp:extract_url}{feature_url_imdb}{/exp:extract_url}">IMDb</a></li><br />
            {/if}<br />
            {if feature_url_imdb_pro != ""}<br />
                <li><a href="http://{exp:extract_url}{feature_url_imdb_pro}{/exp:extract_url}">IMDb Pro</a></li><br />
            {/if}<br />
            {if feature_url_wikipedia != ""}<br />
                <li><a href="http://{exp:extract_url}{feature_url_wikipedia}{/exp:extract_url}">Wikipedia</a></li><br />
            {/if}<br />
            {if feature_url_other_title != "" && feature_url_other != ''}<br />
                <li><a href="http://{exp:extract_url}{feature_url_other}{/exp:extract_url}">{feature_url_other_title}</a></li><br />
            {/if}</p>
    
    <p>    </ul></p>
    
    <p>{/if}</p>
    
    <p>--}</p>
    
    <p><ul class="feature_buttons"><br />
        <li class="buy_tickets"><a href="/2010/buy-tickets/">Buy Tickets</a></li><br />
    </ul></p>
    
    <p><ul><br />
        {if feature_next_film}<br />
            <li><a href="http://{exp:extract_url}{feature_next_film}{/exp:extract_url}">Next Film</a></li><br />
        {/if}<br />
        {if feature_prev_film}<br />
            <li><a href="http://{exp:extract_url}{feature_prev_film}{/exp:extract_url}">Previous Film</a></li><br />
        {/if}<br />
        <li><a href="http://{path=schedule}">Back To Schedule</a></li><br />
        <li><a href="#primary">Back To Top</a></li><br />
    </ul></p>
    
    <p><!-- END page content --></p>
    
    <p>{/exp:weblog:entries}

  • #2 / Aug 06, 2010 6:24pm

    Jason Morehead

    456 posts

    Regarding the code block above, you’ll notice that a portion of the code has been commented out. However, it shouldn’t be, but it has to be in order for the weblog entries tag to return anything. If I un-comment that portion of the code, than nothing displays, as if the weblog entries tag doesn’t even exist.

    At first, I thought it was a badly-formed or unclosed conditional. However, I can’t seem to find anything. And the template debugging code doesn’t return any errors.

    Any ideas?

  • #3 / Aug 07, 2010 3:30pm

    Greg Salt

    3988 posts

    Hi Jason,

    Please uncomment that block again and then remove discrete sections one by one until your template renders properly again. I would start with conditionals that contain other conditionals. This one for example:

    {if feature_url_official != "" || feature_url_facebook != "" || 
        feature_url_myspace != "" || feature_url_twitter != "" || 
        feature_url_imdb != "" || feature_url_imdb_pro != "" || 
        feature_url_wikipedia != "" || feature_url_other_title != "" || 
        feature_url_other != ""}

    Cheers

    Greg

  • #4 / Aug 08, 2010 12:32am

    Jason Morehead

    456 posts

    Please uncomment that block again and then remove discrete sections one by one until your template renders properly again. I would start with conditionals that contain other conditionals. This one for example:

    That was the very first thing I did, which is how I arrived at that particular set of three fields. And it doesn’t seem to matter which one of those three I un-comment. As long as one of them of is un-commented, the tag doesn’t render properly.

  • #5 / Aug 08, 2010 4:11pm

    Greg Salt

    3988 posts

    Hi Jason,

    Do you have error_reporting switched on? Are you accessing the template while logged in as a Super Admin?

    Cheers

    Greg

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases