EllisLab text mark

This is an archived forum and may no longer be relevant. The active forums are here.

Advanced Search
Categories not working
Posted: 30 May 2012 10:46 AM
Joined: 2009-03-15
59 posts

I have used categories a bazillion times without incident so I think I’m just having a brain failure moment, but for some reason I can not get categories to work and allow the user to sort the entries from the weblog in question by the assigned category. I have the global weblog preferences turned on so that the category_url_titles are being used and the trigger word is “category”.

I stripped out all other code and here is the page I’m having issues with.
http://www.summerbeach.com/rentals/index.php/photogallery-tester/

If you click on a category, say “Sea Chase” the page returns all the entries, not just the ones categorized as Sea Chase as expected.
http://www.summerbeach.com/rentals/index.php/photogallery-tester/category/sea_chase

This is my code:

{exp:weblog:entries weblog="photos" limit="100" dynamic="on" category_group="2"}
          <!-- ======= div for rental preview starts ========= -->
          <div>
                <h4>Category Assigned: {categories}<a href="http://{site_url}index.php/photogallery-tester/category/{category_url_title}">{category_name}</a>{/categories}</h4>
<p>                <div><br />
                       <a href="http://{site_url}index.php/photogallery/view/{url_title}">{exp:imgsizer:size src="{gallery-cover}" width="209" height="223" alt="{title}" title="{title}"}</a><br />
                </div><br />
              </p><h4>{title}</h3> 
          </div>
          <!-- ======= div for rental preview ends ========= -->
           {/exp:weblog:entries}

I also tried

{exp:weblog:entries weblog="photos" limit="100" dynamic="on" category_group="2"}
          <!-- ======= div for rental preview starts ========= -->
          <div>
                <h4>Category Assigned: {categories}{category_name}{/categories}

<div>
{exp:imgsizer:size src="{gallery-cover}" width="209" height="223" alt="{title}" title="{title}"}
</div>
<h4>{title}</h3>
</div>
<!-- ======= div for rental preview ends ========= -->
{/exp:weblog:entries}

What am I doing wrong? Running ExpressionEngine v 1.7.0

Posted: 30 May 2012 12:55 PM   [ # 1 ]
Avatar
Joined: 2002-12-06
5009 posts

What happens if you remove the dynamic and category group parameters?

 Signature 

Get the missing EE2 owner’s manual - a complete guide to building an EE2 site.  It’s available in PDF or print.

Posted: 30 May 2012 01:03 PM   [ # 2 ]
Joined: 2009-03-15
59 posts

It worked. So simple. Gah. Thanks!

Posted: 30 May 2012 01:04 PM   [ # 3 ]
Avatar
Joined: 2002-12-06
5009 posts

Check the docs on the category_id parameter to understand why…;)

 Signature 

Get the missing EE2 owner’s manual - a complete guide to building an EE2 site.  It’s available in PDF or print.

Posted: 30 May 2012 05:58 PM   [ # 4 ]
Avatar
Joined: 2011-11-25
7174 posts

Hey gofreshdesign,

I am glad to see that Mike was able to help you out!

If you need anything else, please just let me know by opening a new thread.

Cheers,

 Signature 

ExpressionEngine Support