ExpressionEngine CMS
Open, Free, Amazing

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.

no_results displays even though there are weblog entries unless category selected

August 16, 2010 8:43pm

Subscribe [4]
  • #1 / Aug 16, 2010 8:43pm

    bradhardinge

    2 posts

    Hello,

    I am fairly new to EE but have really enjoyed it so far. This is the first problem I’ve had that I haven’t been able to find a solution for. I have 2 weblogs, 1 for articles and 1 for case-studies. I am using the code on each template to display them, there is a category submenu to filter the weblog entries. The articles page works fine but the case studies page triggers no_results even though there is case studies unless I filter by category and then everything works fine. How can I get all the case-studies to display by default?

    Here is the code for the case-studies template:

    {exp:weblog:category_heading weblog="case-studies"} 
    <h2>{category_name}</h2>
    <p>{/exp:weblog:category_heading}</p>
    
    <p>{exp:weblog:entries weblog="case-studies" status="not closed" orderby="date"}</p><h2><a href="http://{title_permalink=">{title}</a></h2>
    <p>Posted on {entry_date format="%M %d, %Y at %h:%i %A"} in {categories backspace="1"}<a href="http://{path=approach/case-studies}">{category_name}</a>, {/categories} by {author}<br />
    {article-summary}<br />
    <a href="http://{title_permalink=">Read More</a><br />
    {if no_results}There are currently no case-studies published{if segment_4!=""} in this category{/if}.{/if}<br />
    {/exp:weblog:entries}

    There is an include for the category sub nav:

    <ul id="sub-menu">
        <li{if embed:section == "Approach"} class="selected"{if:else}{/if}><a href="http://{path=approach}">Approach</a></li>
        <li{if embed:section == "Case Studies"} class="selected"{if:else}{/if}><a href="http://{path=approach/case-studies}">Case Studies</a>
            <ul>
                <li><h4>Practice Area:</h4>
    <p>                <ul><br />
                        {exp:weblog:categories weblog="case-studies" show_empty="yes" style="linear" category_group="1"}<br />
                        <li{if segment_4==category_url_title} class="selected"{/if}><a href="http://{path=approach/case-studies}">{category_name}</a></li><br />
                        {/exp:weblog:categories}<br />
                    </ul><br />
                </li><br />
                <li></p><h4>Other:</h4>
    <p>                <ul><br />
                        <li{if segment_3==""}{if segment_2=="case-studies"} class="selected"{/if}{/if}><a href="http://{path=approach/case-studies}">View all</a></li><br />
                        {exp:weblog:categories weblog="case-studies" show_empty="yes" style="linear" category_group="3"}<br />
                        <li{if segment_4==category_url_title} class="selected"{/if}><a href="http://{path=approach/case-studies}">{category_name}</a></li><br />
                        {/exp:weblog:categories}<br />
                    </ul><br />
                </li><br />
            </ul><br />
        </li><br />
    </ul>

    Thanks for any help!

    Brad

  • #2 / Aug 17, 2010 11:51am

    helbnt

    143 posts

    Hey Brad,

    I’m certainly no expert, but in your case-studies template, it looks as if the title_permalink tags aren’t formatted correctly. I believe it needs to be either:

    {title_permalink="channel/archives"}

    Or just

    {title_permalink}

    You might start there and see where that gets you.

    -helbnt

  • #3 / Aug 17, 2010 4:10pm

    Ingmar

    29245 posts

    Welcome to the forums, bradhardinge! Does that help? I, too, would suggest to start with a minimal template and take it from there.

  • #4 / Aug 17, 2010 9:21pm

    bradhardinge

    2 posts

    Thanks for the tips guys. I’m not sure why the permalink’s weren’t formatted correctly when I copy pasted them in. They are in the template and that wasn’t the issue. It was actually because I had created another weblog for simple webpages and created an entry for the case studies page before I created the separate case studies weblog. As soon as I deleted the case studies page weblog entry everything worked fine.

  • #5 / Aug 18, 2010 3:28pm

    Ingmar

    29245 posts

    So, just to make sure: you’re up and running?

  • #6 / Aug 18, 2010 8:43pm

    bradhardinge

    2 posts

    Yep. Thank you.

  • #7 / Aug 19, 2010 9:50am

    Sue Crocker

    26054 posts

    Glad you were able to figure out what the problem was. Don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases