1

I'm trying to create a native EE blog to move away from wordpress but the native categories are proving to be quite difficult. I've got the listing of categories showing, but directing them to their category template shows all channel entries and not just the category specified in the url. Code is below.

{exp:channel:categories channel="blog" style="nested" class="categories"}
    <a href="{path='blog/index'}">{category_name}</a>
{/exp:channel:categories}

The click action works as desired and brings you to a url string

domain.com/blog/category/category_name

Category headings work fine

{exp:channel:category_heading channel="blog"}
    <h1>{category_name}</h1>
{/exp:channel:category_heading}

Displays "Category Name"

But then the actual categories do not display. It's as if there's simply no entries matching this category.

{exp:channel:entries channel="blog" disable="members|pagination" related_categories="yes" custom_fields="yes" dynamic="no" status="Open" sort="desc"}
    <article class="blog-article">
        <figure><img src="{blog_image}" alt="{title}"></figure>
        <div class="blog-details">
                <p>By: {author} <a href="{url}" target="_blank"><i class="icon-twitter"></i></a></p>
                <p> <i class="icon-time"></i> {entry_date format='%F %d, %Y'}</p>
                <p> <a href="{page_url}"><i class="icon-comments"></i> {comment_total} Comments</a></p>
            </div>
            <h1>{title}</h1>
            {intro_text}
            <a href="{page_url}" class="magenta">Read More</a>
    </article>
{/exp:channel:entries}
1

The issue above was solved by changing the dynamic setting. Originally the setting was

{exp:channel:entries channel="blog" disable="members|pagination" related_categories="yes" custom_fields="yes" dynamic="no" status="Open" sort="desc"}

Changing dynamic="no" to dynamic="yes"

{exp:channel:entries channel="blog" disable="members|pagination" related_categories="yes" custom_fields="yes" dynamic="yes" status="Open" sort="desc"}

Solved the problem.

| improve this answer | |
  • 1
    Do you understand why? ;) – Michael Boyink Jun 27 '14 at 15:36
  • Yes absolutely, they have to be tied to the category we're passing in the url. It's one of those things where I wasn't even reading my code until I posted it. – thatgibbyguy Jun 27 '14 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.