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.

Displaying no entries in a category

March 13, 2012 4:21pm

Subscribe [2]
  • #1 / Mar 13, 2012 4:21pm

    24here

    69 posts

    Hello, I have some categories (one ID1, two ID2, three ID3) and all categories has entries, status open, not expired =) working entries

    I have next tag

    {exp:channel:entries channel="mychannel" status="open" category_id="some number" disable="category_fields|member_data"}  
    {title} <br>
    {/exp:channel:entries}

    and when I have this url http://***/template_group/category/one/
    I see some entries

    when I have this url http://***/template_group/category/two/
    I don’t see any entries
    but when I use category_id=“2” parameter it work good…


    But there is no parameter category_id in docs http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html
    Why this work?????

     

  • #2 / Mar 14, 2012 3:24pm

    Shane Eckert

    7174 posts

    Hello 24here,

    I am sorry to hear you are running into this snag.

    You are correct, category_id=“” is not a parameter of the Channel Entries Tag. It is a tag pair, but not a parameter. I do not know why that made it work, I copied your code above and played with category_id=”” and it did not matter what I put in there, it was ignored, as it should be.

    Can you show me more of the template. I am not getting the full picture of how you are trying to accomplish this. The whole template would be good and the link that brings you to the template.

    Thank you,

  • #3 / Mar 22, 2012 12:43am

    24here

    69 posts

  • #4 / Mar 23, 2012 8:23pm

    Sean C. Smith

    3818 posts

    Hi 24here,

    That template has a lot going on in it. I’d like you to simplify the template to use only the code that is not working correctly for you. If this is on a live site then I recommend creating a test template and strip down your code there to see if we can get this working. I’d first like to get rid of all the conditionals so that we can focus down on the relevant code.

    Based on what I read above and what I see in the template I’m guessing that this buit is the relevant section. Is this correct?

    {if:else}
        <!--h3 style="text-transform: uppercase;">{segment_3_category_name}</h3-->
        {segment_3_category_description}
        <div class="catalog">
         {exp:channel:entries channel="compl" url_title="not primechanie|sborka" status="open"
            category_id="{segment_3_category_id}"
            disable="category_fields|member_data"}
            <div class="item">
                <div class="project" >
                    <a href="http://{comment_url_title_auto_path}">{exp:ce_img:pair src="{pic}" height="80" crop="yes" auto_cache="_cache"}{made}{/exp:ce_img:pair} </a>
                    <div class="name"><b><a href="http://{comment_url_title_auto_path}">{title}</a></b> {if member_group == '1' OR member_group == '6'} <a href="/adm/index.php?S=0&D=cp&C=content_publish&M=entry_form&channel;_id={channel_id}&entry;_id={entry_id}">/images/edit.gif/a>{/if} </div>
                    <!--div class="price"></div-->
                </div><!--.project-->
            </div><!--.item-->
      {switch='|||<div class="clear"></div>'}
      {/exp:channel:entries}
      <div class="clear"></div>
        </div><!--.catalog-->
    {/if}
  • #5 / Mar 24, 2012 4:08am

    24here

    69 posts

    Hi, Sean.

    Yes this part of code output my entries

  • #6 / Mar 27, 2012 1:46pm

    Shane Eckert

    7174 posts

    Hey 24here,

    Did you get a chance to create a new template and test out the code block above per Sean’s directions?

    Cheers,

  • #7 / Mar 27, 2012 2:40pm

    24here

    69 posts

    Yes I did it, the same result. Also I clear all my template and left only this code (with category=”“) - nothing

  • #8 / Mar 30, 2012 5:20pm

    Shane Eckert

    7174 posts

    Hey 24here,

    This is odd.

    Are you using any Add-Ons like Structure that deal with the URL?

    What is the issue you are having now. If segment three is one it works but anything else does not work?

    You might also look through your conditionals and see if you are not running into a Parse Order issue.

    Please let me know what Add-Ons you are using.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases