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.

Single category content will not populate

May 08, 2014 2:53pm

Subscribe [3]
  • #1 / May 08, 2014 2:53pm

    nkatarow

    2 posts

    So I’ve just started working for a new studio and inherited their expression engine website. This is the first time I’ve worked with it (though I’ve been EE curious for a while). They have a channel/page called “work” in which their portfolio items live. The channel has a large number of categories contained within so that the user can filter to see all portfolio items related to that category. All of the categories (minus one) will populate their category page as intended when selected.

    ie: When user selects “logo” from the category drop down, they are sent to “/work/category/logo-identity” where all logo items are shown.

    When the user selects “branding”, they’re directed to the correct page “/work/category/branding”,  however, the page is empty even though in EE there are plenty of items assigned to that category.

    I haven’t been able to figure out why this one item will not populate it’s page (note that this USED to work fine). Any ideas?

    Code that populates filter:

    {exp:ce_cache:it id="work" tags="work|category"}
      {embed='shared/_header' body_class="work work-index"}
      
        <section class="content subnav-dropdown">
          <ul class="work-subnav">
            <li class="nav-block">
              {if segment_2 == 'category'}
                <a href="#%22class=%22nav-link" class="nav-link category active">{segment_3_category_name}</a>
              {if:else}
                <a href="#%22class=%22nav-link" class="nav-link category">Category</a>
              {/if}
              <ul class="drop-down first">
                {exp:channel:categories channel="work" category_group="1"}
                    <a href="/work/category/{category_url_title}">{category_name}</a>
                {/exp:channel:categories}
              </ul>
            </li>
          </ul>
        </section>
        
        {exp:ce_cache:escape}
    
          {if segment_3 != ""}
            {exp:cookie_plus:set name="work_category_name" value="{segment_3_category_name}" seconds="0"}
            {exp:cookie_plus:set name="work_category_id" value="{segment_3_category_id}" seconds="0"}
          {/if}
      
          {if segment_3 == ""}
            {exp:cookie_plus:set name="work_category_name" value="Featured" seconds="0"}
            {exp:cookie_plus:set name="work_category_id" value="3" seconds="0"}
          {/if}
          
        {/exp:ce_cache:escape}
        
        {embed='work/_work_listing' category_id="{if segment_3_category_id == ""}3{if:else}{segment_3_category_id}{/if}"}
      {embed='shared/_footer'}
    {/exp:ce_cache:it}
  • #2 / May 08, 2014 8:53pm

    Rob Allen

    3108 posts

    Welcome to the forums!

    A couple of things to check:

    1. What is the status of the missing entries, Open, Closed?
    2. Is the “branding” category a top level category or second level category? Also what is the ID number of that category?

    It may help if you post you work/_work_listing template as well 😊

  • #3 / May 09, 2014 1:43pm

    nkatarow

    2 posts

    Hi Rob, thanks for the response!

    1. The status of the missing entries are all open.
    2. I believe the “Branding” category is second level. When I go to admin -> channel administration -> categories, there’s a top level list of categories. I then drill down into “Category” (ID = 1), then I find Branding and the rest of the categories that are showing fine. The “Branding” ID is 38.

    Here’s the “_work_listing” template as requested.

    <section class="content no-mar">
    
      {exp:channel:entries channel="work" orderby="work_entry_order" category="{embed:category_id}" dynamic="off" global:param_disable_default}
        <article class="work-intro {switch='|||last'}" data-entry-id="{entry_id}">
          <a href="/work/detail/{url_title}class=block">_        {thumbnail}_        <footer class="work-intro-footer">_          <span class="work-intro-title">_              {categories show_group="2"}_                {category_name}_              {/categories}_          </span>_          <span class="work-intro-category">_            {exp:eehive_hacksaw chars="30" append="..."}{work_thumbnail_title}{/exp:eehive_hacksaw}_          </span>_        </footer>_        <div class="work-intro-hover">_          <span class="work-intro-title">_            {categories show_group="2"}_              {category_name}_            {/categories}_          </span>_          <span class="work-intro-category">_            {exp:eehive_hacksaw chars="30" append="..."}{work_thumbnail_title}{/exp:eehive_hacksaw}_          </span>_        </div>_      </a>
        </article>
      {/exp:channel:entries}
    </section>
  • #4 / May 10, 2014 8:07am

    Boyink!

    5011 posts

    I’ve never understood the need to force-feed category IDs as a parameter when the URL will cause that to be applied anyway.  My gut feeling is that whoever originally coded this didn’t understand the dynamic nature of EE’s channel entry tag.

    I’d try stripping out all the category Id passing and assigning and see if EE will serve up the content correctly based on the URL it’s being displayed with.

    And do note, this is EE2 code being posted in the EE1 support forum..😉

  • #5 / May 21, 2014 6:40pm

    nkatarow

    2 posts

    Just an update on this…

    It appears that there isn’t necessarily anything in the code that caused this. I eventually tested rolling back the database and everything populated as expected. The only way I could get the items to reappear was to delete the category completely in EE, and then re-add it as a new category and assign each of the items to the new category manually.

    Not sure what would have caused this, if anyone has any idea of what could have happened please let me know. Otherwise, problem is solved for the time being.

    Also, apologies for accidentally posting this in the EE1 forum!

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

ExpressionEngine News!

#eecms, #events, #releases