1

Simple as can be, my code, but I am getting all the entries, not just those in category 42.

{exp:channel:entries channel="patient-services"   
disable="member_data|pagination" 
dynamic="no" sort="asc" orderby="title" category="42"}
    <li><a href="{url_title_path=patient-services}">
    {title}    
</a></li>
{/exp:channel:entries}

UPDATE I stripped it down to this, but it's showing that every entry is in category 42, even though the CP shows otherwise. Maybe I hit a bug?

{exp:channel:entries id="18" dynamic="no" category="42"}
    <li><a href="{url_title_path=patient-services}">{title}</a>Category id
    is: {categories}{category_id}{/categories}</li>
{/exp:channel:entries}
1
  • 2
    Are you sure that that specific category_id is correct and exists? – Wouter Dec 12, 2012 at 0:21

1 Answer 1

2

Your code is correct so I'd start troubleshooting with these three things:

  1. Make sure your channel short name is correct (copy and paste it to be sure)
  2. Make sure your category id is correct
  3. Add dynamic="no" parameter to your channel:entries tag
  4. EDIT Check your URL paths. A entries tag can seemingly misbehave if you have a misspelling in the template name. Let's say your template is /blog/entry but you are calling /blog/entryy by mistake. EE will not find the "entryy" template because it doesn't exist and so will try to load the index template in the blog template group instead. A good test would be to create a "test" template group and insert your code into that index template. If it works here, then something related to the URL may be in play.
4
  • 2
    yup, break it down to the basics and build it back up. Start with just channel name and dynamic="no" and work from there. Dec 12, 2012 at 5:12
  • 2
    dynamic="no" is there in her code, other than that I completely agree with MediaGirl on the things to look at first, and with Steven that if those things turn out to not be right start by stripping the tag (and really the template) down to the minimum possible complexity and build from there until you get your issue back or have built back up to the solution you were trying to get to. In the latter case, hot dang, you are good to go. In the former, now you know a lot more about what is going wrong.
    – UltraBob
    Dec 12, 2012 at 8:23
  • Turns out to be PEBMAK - Problem exists between monitor and keyboard!
    – 4midori
    Dec 21, 2012 at 1:32
  • I have that same problem!
    – Anna_MediaGirl
    Dec 21, 2012 at 6:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.