EllisLab text mark
Advanced Search
     
Categories not working
Posted: 30 May 2012 10:46 AM
Joined: 2009-03-15
87 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="{site_url}index.php/photogallery-tester/category/{category_url_title}">{category_name}</a>{/categories}</h4>
                <
div>
                       <
a href="{site_url}index.php/photogallery/view/{url_title}">{exp:imgsizer:size src="{gallery-cover}" width="209" height="223" alt="{title}" title="{title}"}</a>
                </
div>
               <
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}<a href="{path='summerbeach/photogallery-tester'}">{category_name}</a>{/categories}</h4>
                <
div>
                       <
a href="{site_url}index.php/photogallery/view/{url_title}">{exp:imgsizer:size src="{gallery-cover}" width="209" height="223" alt="{title}" title="{title}"}</a>
                </
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 ]   [ Rating: 0 ]
Avatar
Joined: 2002-12-06
4640 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 ]   [ Rating: 0 ]
Joined: 2009-03-15
87 posts

It worked. So simple. Gah. Thanks!

 
Posted: 30 May 2012 01:04 PM   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2002-12-06
4640 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 ]   [ Rating: 0 ]
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