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.

Categories not working

May 30, 2012 10:46am

Subscribe [3]
  • #1 / May 30, 2012 10:46am

    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

  • #2 / May 30, 2012 12:55pm

    Boyink!'s avatar

    Boyink!

    5011 posts

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

  • #3 / May 30, 2012 1:03pm

    It worked. So simple. Gah. Thanks!

  • #4 / May 30, 2012 1:04pm

    Boyink!'s avatar

    Boyink!

    5011 posts

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

  • #5 / May 30, 2012 5:58pm

    Shane Eckert's avatar

    Shane Eckert

    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,

ExpressionEngine News

#eecms, #events, #releases