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.

Category archive pages not displaying properly (problem with dynamic=off parameter, I think)

January 28, 2011 9:22am

Subscribe [3]
  • #1 / Jan 28, 2011 9:22am

    aerometric

    9 posts

    Version 1.6.9
    Build: 20100430

    I’m having an issue getting the category archive pages to display properly for a weblog that I’m using like a typical blog.

    The main blog landing page is here: http://www.aerometric.com/insight/

    “Insight” is the weblog name. In global channel preferences, I’ve set “topic” to be the category url indicator.

    The category archive links are in the gray column on the left. If you click on “lidar” or “aerial photography”, the category archive page displays properly. But for “whitepapers” and “presentations”, it will actually crash your browser trying to load them. Unfortunately, it doesn’t give me any kind of error message.

    I’ve tested different category names, and if there are other pages on the site (static pages in other weblogs), then the category archive page works. It’s when the category name is not also being used elsewhere that the archive pages don’t display.

    I’m using one template for both the main landing page & the category archives… insight/index. When I exp:weblog:entries tag contained dynamic=off, the main landing page displayed fine, but the categories were not filtering. When I removed dynamic=off, the category archives filtered properly, but no entries were displayed on the main landing page anymore.

    So currently, I’m using an if statement, checking for “topic” in segment_2, and using one exp:weblog:entries tag for category archives, and another one for the main landing page. The only difference in the two is the dynamic=off parameter.

    Bottom line: I just want ALL the category archive pages displaying correctly. Here’s my code from the insight/index template:

    {if segment_2 == ""}
        {exp:weblog:entries weblog="insight" limit="8" show_future_entries="yes" orderby="date" disable="trackbacks" dynamic="off"}
                <div class="project">
                    <a href="http://{title_permalink=insight/post}">_                {exp:imgsizer:size just_url="yes" src="{insight_author_thumb}" width="90" height="90" quality="70"}_                {sized}_                {/exp:imgsizer:size}_                </a>
                    <h2><a href="http://{title_permalink=insight/post}">{title}</a></h2>
    <p>                </p><h3>{entry_date format="%M %j, %Y"}</h3>
    <p>                {exp:md_eexcerpt if_exceeds="30" stop_after="30"}{insight_content}{/exp:md_eexcerpt}</p>
    
    <p>                <a href="http://{title_permalink=insight/post}">Read the full insight »</a><br />
                </div><br />
                {/exp:weblog:entries}<br />
                {/if}<br />
                <br />
                {if segment_2 == "topic"}    <br />
                {exp:weblog:entries weblog="insight" limit="8" show_future_entries="yes" orderby="date" disable="trackbacks"}<br />
                <div class="project"><br />
                    <a href="http://{title_permalink=insight/post}">_                {exp:imgsizer:size just_url="yes" src="{insight_author_thumb}" width="90" height="90" quality="70"}_                {sized}_                {/exp:imgsizer:size}_                </a><br />
                    </p><h2><a href="http://{title_permalink=insight/post}">{title}</a></h2>
    <p>                </p><h3>{entry_date format="%M %j, %Y"}</h3>
    <p>                {exp:md_eexcerpt if_exceeds="30" stop_after="30"}{insight_content}{/exp:md_eexcerpt}</p>
    
    <p>                <a href="http://{title_permalink=insight/post}">Read the full insight »</a><br />
                </div><br />
                {/exp:weblog:entries}<br />
                {/if}

  • #2 / Jan 29, 2011 1:57pm

    Greg Salt

    3988 posts

    Hi aerometric,

    Firstly, please upgrade to the latest version and build when possible. It’s possible that you are trying to fix a problem that is caused elsewhere on your template because if ‘topic’ is your Category URL Indicator this should work without using the conditionals. Are you using conditionals checking for segment_2 anywhere else? Please post your full template - you can remove the majority of the HTML but please leave in all your EE tags.

    Cheers

    Greg

  • #3 / Jan 29, 2011 8:15pm

    aerometric

    9 posts

    Greg,

    I’ll post the entire template on here tomorrow, but in the meantime, do you guys have any references that would help me identify possible hiccups when upgrading?

    I’m using quite a few modules/extensions/add-ons, and I’m concerned things might start breaking when I upgrade. Is there an upgrade cheatsheet or checklist of sorts?

    And when you say upgrade, do you just mean the latest build of version 1? Or do you suggest I upgrade to the latest version of 2?

    Thanks.

  • #4 / Jan 31, 2011 3:00am

    John Henry Donovan

    12339 posts

    aerometric,

    And when you say upgrade, do you just mean the latest build of version 1? Or do you suggest I upgrade to the latest version of 2?

    The latest version of EE1.x which is 1.7. This is a version upgrade from 1.6.9 so be sure to follow the version upgrade docs

    I’m using quite a few modules/extensions/add-ons, and I’m concerned things might start breaking when I upgrade. Is there an upgrade cheatsheet or checklist of sorts?

    I’d say you should be ok with the upgrade to EE1.7. If you were moving up to EE2 then that would be a different story entirely as you would need EE2 compatible versions of all those third-party add-ons.

    But that isn’t required in this case. We are just recommending you upgrade tot eh the latest version of the EE1.x branch

    We will tackle your template when you post it. I cam guessing a nesting issue of embeds maybe

  • #5 / Feb 01, 2011 10:38am

    aerometric

    9 posts

    Thanks John. I will upgrade the site to 1.7 tonight, after hours. In the meantime, here is the code I’m using on my insight/index template, which is powering both the main list of blog posts, as well as the category listings of blog posts.

    You’ll also notice a few tags from the matrix add-on. They’re not standard EE tags, but I kept all of those in there as well.

    Here’s the code:

    {exp:weblog:entries weblog="pages"}
    {embed="layout/header" page_title="{if segment_2 == ""}
    {if page_seo_title}{page_seo_title}{if:else}{title}{/if}{/if}
    {if segment_2 == "topic"}AeroMetric Insight - {exp:weblog:category_heading weblog="insight"}{category_name}{/exp:weblog:category_heading}{/if}" meta_description="{if segment_2 == ""}{page_meta_description}{/if}{if segment_2 == "topic"}{exp:weblog:category_heading weblog="insight"}{category_description}{/exp:weblog:category_heading}{/if}"}
    
    <div id="highlight-full">
            {if page_highlighted_insights}
            <div id="highlight">
            {page_highlighted_insights limit="4"}
            <div>
                <a href="http://{title_permalink=%27insight/post%27}" title="Read full insight »">{insight_single_post_image}</a>
                
                    <a href="http://{title_permalink=%27insight/post%27}" title="Read full insight »">_                <strong>{if insight_short_title}{insight_short_title}{if:else}{title}{/if}</strong>_                {insight_summary}_                </a>
                
            </div>
            {/page_highlighted_insights}
            </div> <!-- /#highlight -->
            {if:else}
            <div id="about-highlight">
            /uploads/images/projects/valley-international-airport.jpg 
        </div> <!-- /#about-highlight -->
        {/if}
    </div> <!-- /#highlight-full -->
    <div id="main-full">
        <div id="main">
            <div id="breadcrumbs">
                <ol id="crumbs">
                    {if segment_2 == ""}
                        {exp:structure:breadcrumb here_as_title="yes" wrap_each="li" wrap_separator="span"}
                    {/if}
                    {if segment_2 == "topic"}
                        <li><a href="/">Home</a><span>»</span></li>
                        <li><a href="/insight/">Insight</a><span>»</span></li>
                        <li>{exp:weblog:category_heading weblog="insight"}{category_name}{/exp:weblog:category_heading}</li>
                    {/if}
                </ol>
            </div> <!-- /#breadcrumbs -->
            <div id="leftnav">
                {embed="includes/insight-category-nav"}
            </div> <!-- /#leftnav -->
    {/exp:weblog:entries}
    
            <div id="content-full">
                {exp:weblog:category_heading weblog="insight"}
                    <h1>{category_name} Insight</h1>
                {/exp:weblog:category_heading}
                
                {exp:weblog:entries weblog="insight"}
                {if segment_2 != "topic" AND segment_3 != ""}
                    {date_heading display="monthly"}
                        <h1>Insight from {entry_date format="%F %Y"}<span>Subscribe: <a href="http://feeds.feedburner.com/aerometric/insight" title="RSS Feed" class="rss-feed">RSS Feed</a> <a href="http://feedburner.google.com/fb/a/mailverify?uri=aerometric/insight&loc=en_US" title="Email Feed" class="email-feed" target="_blank" rel="noopener">Email Feed</a></span></h1>
                    {/date_heading}
                {/if}
                {/exp:weblog:entries}
                
                {if segment_2 == ""}
                {exp:weblog:entries weblog="pages"}
                <h1>{if page_title}{page_title}{if:else}{title}{/if}</h1>
                {/exp:weblog:entries}            
                {exp:weblog:entries weblog="insight" limit="8" show_future_entries="yes" orderby="date" disable="trackbacks" dynamic="off"}
                <div class="project">
                    <a href="http://{title_permalink=insight/post}">_                {exp:imgsizer:size just_url="yes" src="{insight_author_thumb}" width="90" height="90" quality="70"}_                {sized}_                {/exp:imgsizer:size}_                </a>
                    <h2><a href="http://{title_permalink=insight/post}">{title}</a></h2>
    <p>                </p><h3>{entry_date format="%M %j, %Y"}</h3>
    <p>                {exp:md_eexcerpt if_exceeds="30" stop_after="30"}{insight_content}{/exp:md_eexcerpt}</p>
    
    <p>                <a href="http://{title_permalink=insight/post}">Read the full insight »</a><br />
                </div><br />
                {/exp:weblog:entries}<br />
                {/if}<br />
                <br />
                {if segment_2 == "topic"}    <br />
                {exp:weblog:entries weblog="insight" limit="8" show_future_entries="yes" orderby="date" disable="trackbacks"}<br />
                <div class="project"><br />
                    <a href="http://{title_permalink=insight/post}">_                {exp:imgsizer:size just_url="yes" src="{insight_author_thumb}" width="90" height="90" quality="70"}_                {sized}_                {/exp:imgsizer:size}_                </a><br />
                    </p><h2><a href="http://{title_permalink=insight/post}">{title}</a></h2>
    <p>                </p><h3>{entry_date format="%M %j, %Y"}</h3>
    <p>                {exp:md_eexcerpt if_exceeds="30" stop_after="30"}{insight_content}{/exp:md_eexcerpt}</p>
    
    <p>                <a href="http://{title_permalink=insight/post}">Read the full insight »</a><br />
                </div><br />
                {/exp:weblog:entries}<br />
                {/if}

    I closed all the HTML <div> tags at the end, just didn’t include them here.

    You’ll notice I used 2 different weblog:entries tags for index and for categories. The dynamic=off parameter is the thing I changed.

    I know it’s a lot of code. Thanks for taking the time to look it over.

  • #6 / Feb 02, 2011 3:45am

    John Henry Donovan

    12339 posts

    aerometric,

    What I suggest here is to start reducing your template down or in your case maybe start building from the center out again to try and find the culprit. Make a backup of your template first. You have a lot of conditionals going on. Even the header embed has 4 or 5 conditionals and you are nesting the category heading tag inside of it. You need to reduce these and the rest in your testing.

    Use your test URL as http://www.aerometric.com/insight/topic/whitepapers/

    Then in your template start with the following and work out from that add pieces at a time

    {exp:weblog:entries weblog="insight" limit="8" show_future_entries="yes" orderby="date" disable="trackbacks"}
                <div class="project">
                    <a href="http://{title_permalink=insight/post}">_                {exp:imgsizer:size just_url="yes" src="{insight_author_thumb}" width="90" height="90" quality="70"}_                {sized}_                {/exp:imgsizer:size}_                </a>
                    <h2><a href="http://{title_permalink=insight/post}">{title}</a></h2>
    <p>                </p><h3>{entry_date format="%M %j, %Y"}</h3>
    <p>                {exp:md_eexcerpt if_exceeds="30" stop_after="30"}{insight_content}{/exp:md_eexcerpt}</p>
    
    <p>                <a href="http://{title_permalink=insight/post}">Read the full insight »</a><br />
                </div><br />
                {/exp:weblog:entries}

  • #7 / Feb 07, 2011 2:46pm

    aerometric

    9 posts

    John,

    I’m taking your suggestion & trimming out a lot of the conditionals, and starting from the inside and working my way out.

    2 quick questions on different EE tags, and where they should go:

    {exp:weblog:category_heading} and {exp:weblog:categories}...

    Can they be found inside an {exp:weblog:entries} tag? Or should they stand alone, outside of any {exp:weblog:entries} tags?

    And if they are allowed inside an {exp:weblog:entries} tag, do they have to be within the {exp:weblog:entries} tag that refers to the same weblog that the categories are for? Or could they be embedded inside a different {exp:weblog:entries} tag?

    Thanks.

  • #8 / Feb 08, 2011 8:18am

    Sue Crocker

    26054 posts

    Hi, aerometric.

    Here’s an example taken from the default templates that ship with EE1.7:

    {exp:weblog:category_heading weblog="{my_weblog}"}
    <h2>{category_name}</h2>
    <p>{if category_description}<br />
    {category_description}<br />
    {/if}<br />
    {/exp:weblog:category_heading}</p>
    
    <p><br />
    {exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="15" disable="member_data|trackbacks"}</p>
    
    <p><div class="entry"></p>
    
    <p>{date_heading}<br />
    <h3 class="date">{entry_date format=' %l, %F %d, %Y '}</h3><br />
    {/date_heading}</p>
    
    <p><h2 class="title">{title}</h2><br />
    {summary}</p>
    
    <p>{body}</p>
    
    <p>{extended}</p>
    
    <p><div class="posted">Posted by {author} on {entry_date format='%m/%d'} at {entry_date format='%h:%i %A'}</p>
    
    
    
    <p><br />
    {categories}<br />
    <a href="http://{path=site_index}">{category_name}</a> •<br />
    {/categories}</p>
    
    <p>{if allow_comments}<br />
    ({comment_total}) <a href="http://{url_title_path=">Comments</a> •<br />
    {/if}</p>
    
    <p>{if allow_trackbacks}<br />
    ({trackback_total}) <a href="http://{trackback_path=">Trackbacks</a> •<br />
    {/if}<br />
    <a href="http://{title_permalink={my_template_group}/index}">Permalink</a></p>
    
    <p></div></p>
    
    <p>{paginate}</p>
    
    <p><div class="paginate"></p>
    
    <p><span class="pagecount">Page {current_page} of {total_pages} pages</span>  {pagination_links}</p>
    
    <p></div></p>
    
    <p>{/paginate}</p>
    
    <p></div></p>
    
    <p>{/exp:weblog:entries}

    The exp:weblog:category_heading is *outside* the main exp:weblog:entries tag, and inside the exp:weblog:entries tag, you use the {category}{/category} loop to display the categories associated with that particular entry.

    Does that help?

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

ExpressionEngine News!

#eecms, #events, #releases