Thanks for the help!
OK…let’s just make sure some basics are in place:
- You have a weblog.
Yes.
- You have a category group with categories, descriptions and a custom category field of some sort.
Yes.
- You have the category group assigned to the weblog.
Yes.
- You have posts in the weblog assigned to the categories.
Yes.
OK - on to the code. You mention a if statement looking at for a “topic” value—is that the value you’ve setup as your keyword to tell EE you want a category page (under admin > weblog preferences > global weblog preferences)? The default is “category” - so I assume you’ve changed it.
Yes.
Now - we need to see the code for the whole template, and how you’re linking to it. Do you have nav being built with the weblog:categories tag?
Index.php which is embedding _body.php—basically what was in index before:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
{embed="{my_template_group}/_header" pagetitle="{pagetitle}" metad="{metad}" metak="{metak}"}
<!--blog/index-->
{embed="{my_template_group}/_body"}
{embed="{my_template_group}/_side"}
{if segment_2 == ""}{embed="{my_template_group}/_footer" closing=""}
{if:else}{embed="{my_template_group}/_footer" closing="{closing}"}
{/if}
_body.php - I’ve tried a number of versions but here is the current one:
{exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="1"}
{if segment_2 == "topic"}
{categories}
<h1>{category_name}</h1>
{/categories}
{/if}
{/exp:weblog:entries}
{exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="15"}
<!-- entry -->
<div class="entry">
<div class="entry-title"><h3><a href="http://{url_title_path=">{title}</a></h3><p></div></p>
<p>{if segment_2 == ""}<br />
{summary}</p>
<p>{if:elseif segment_2 != "topic"}<br />
{body}<br />
{extended}<br />
<div class="entry-info"></p>
<p>{if allow_comments}<br />
({comment_total}) Comments • <br />
{/if}</p>
<p>{if allow_trackbacks}<br />
({trackback_total}) <a href="http://{url_title_path=">Trackbacks</a> • <br />
{/if}<br />
<a href="http://{url_title_path=">Permalink</a> • <br />
{entry_date format=' %l, %F %d, %Y '}</p>
<p><br />
More articles on:<br />
{categories}<br />
<a href="http://{path={my_template_group}}">{category_name}</a><br />
{/categories}</p>
<p><br />
</div><br />
{if:else}<br />
{summary}<br />
{/if}</p>
<p></div><br />
<!-- entry --></p>
<p>{paginate}<br />
<div class="navi-pages"><br />
Page {current_page} of {total_pages} pages {pagination_links}<br />
</div><br />
{/paginate}</p>
<p>{/exp:weblog:entries}