Category link for case-study category returns no list of results, even though there should be - and the count is correct in the link.

  • I’m trying to use the perch blog as a way of posting case studies as well as standard blog posts.


    I have two blog sections: Posts and Case Study.

    I also have two category sets. Blog and Industry Sector


    To use these, I have two post templates. One is the default blog post template which uses the standard blog categories. The other is case-study.html uses the Industry sector categories.


    At the moment, I can build posts either blog or case study, and I list these out on two separate pages, with a side bar showing their respective category links. When I list the category links, they are correct and the count is also correct. However, if I click the category link for my case studies, I’m getting no results listed (even though there are some and the count on the link is correct). I’m at a bit of a loss at what to try next. Any help appreciated!



    Here's the section of case_study.php

    cs_category_link.html

    Code
    1. <perch:before>
    2. <h3>Case Study Categories</h3>
    3. <ul>
    4. </perch:before>
    5. <li>
    6. <a href="/blog/case_study_archive.php?cat=<perch:category id="catSlug" />"><perch:category id="catTitle" /> (<perch:category id="count.blog.post" when-empty="0" />)</a>
    7. </li>
    8. <perch:after></ul></perch:after>

    case_study_archive.php

    In the above case_study_archive.php (which is simply a tweaked archive.php), the perch_get returns the category fine, but the perch_blog_category below is blank, and I don't even think post_in_list.html is being called as I cannot get anything returned from perch:showall.

    Code
    1. echo '<h1>Case Studies in category : '.perch_blog_category(perch_get('cat'), true).'</h1>';
  • drewm

    Approved the thread.
  • One further issue though, for the title in archive.php, I can achieve it with:

    Code
    1. echo '<h1>Case Studies : '. perch_category('industry-sector/'.perch_get('cat'), [], true) .'</h1>';

    However, I actually have three category sets so I can't hardcode the 'industry sector'. Ideally I would like to dynamically list:


    * set title : Category title.


    Is there another way I can achieve this with Perch?