The problem is that it only displays the top level categories. I have my Categories like this:
-Topics -Regions -Africa -Zimbabwe
It should display Zimbabwe, however it is displaying “Topics” and “Regions”
Here is my page:
http://www.technologyandchange.com/1/home/nav/topic/Africa/
Here is a new template:
<code>{assign_variable:master_weblog_name="tech"} <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html > <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>{exp:weblog:info weblog="{master_weblog_name}"}{blog_title}{/exp:weblog:info}</title> <style type='text/css' media='screen'>@import "{stylesheet=home/index-style}";</style> <style type='text/css' media='screen'>@import "{stylesheet=global/headfoot-style}";</style> </head> <body> <div id="container"> {embed="global/header"} <div id="nav"> </div> <div id="content"> <div id="nav-menu"> <div id="title-box">Topics
</div> <table id="nav-menu-table"> {exp:subcategories} <li>{category_name}</li> {/exp:subcategories} </table> </div> <div class="ad-box-2"></div> <div> <div id="title-box">Recent Articles
</div> {exp:weblog:entries weblog="{master_weblog_name}" orderby="date" sort="desc" limit="15"} <div class="post"> <div class="post-title">{title}
</div> <div class="post-details">By {author} on {entry_date format='%m/%d'}</div> <div class="post-summary">{summary}</div> <div class="post-options">Read More...</div> </div> {/exp:weblog:entries} </div> </div> {embed="global/footer"} </div> </body> </html></code>
Hi livenomadic
Regarding your wish to show the following:
a) Category Title b) List of Subcategories of that category c) List of Entries in this (current) category
Use a category that is passed to the template through the url and then place these tags in your template:
a) Use
{exp:weblog:category_heading} {category_name} {/exp:weblog:category_heading}
b) Use
{exp:subcategories …} {category_name} {/exp:subcategories}
c) Use
{exp:weblog:entries …} {title} {/exp:weblog:entries}
Also… How are your categories structured? With subcategories such as:
Topics —Regions ——Africa ———Zimbabwe ———Nigeria ——Europe ———France ———Germany
…or are they all on the same level?
(BTW… regarding your HTML code around the {exp:subcategories tag}. It would make more sense to use the “unordered list” tag <ul> in conjunction with <li> list items tag.>)
And…Here’s one example of how I use the plugin:
<style type="text/css">
<!--
.hide {
display: none;
}
.subcategories {
clear: both;
margin: 0;
padding: 15px 0 0 0;
width: 728px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
img {
border: none;
}
.subcategories h2 {
margin: 0;
padding: 3px 0 0 0;
font-size: 12px;
font-weight: bold;
color: #333;
/*border-top: 1px dashed #807cab;*/
background-image: url(/images/de-layout-basics-2/muster_2.png);
background-position: top;
background-repeat: repeat-x;
}
.subcategories ul {
float: left;
width: 728px;
margin: 0;
padding: 10px 0 0 0;
list-style-type: none;
}
.subcategories ul li {
float: left;
width: 182px;
margin: 0;
padding: 0;
line-height: 1.618em;
font-size: 10px;
}
.subcategories li a {
color: #0033cc;
}
-->
</style>
<div class="subcategories">
<h2>Kategorien</h2>
<ul>
{exp:subcategories sort_by="category_name" count_entries_from_weblogs="22" count_entries_with_status="open|closed"}
<li><a href="http://{template_path=templategroup/template}">{category_name} {if entries_count > 0}({entries_count}){/if}</a></li>
{/exp:subcategories}
</ul>
</div>
When I paste:
{exp:subcategories} {category_name} {/exp:subcategories}
I am getting the wrong categories displayed.
The subcategories of:
http://www.technologyandchange.com/1/home/nav/topic/Africa/
is “Zimbabwe”
But as you can see it is displaying the categories “Regions” and “Topics”
Hey MF, thanks for the great plugin. Like livenomadic I want to use category names rather than category IDs in my URLs. I achieved that by modifying the url_root_node function. Please contact me if you would like to discuss integrating my changes into the official version of the plugin.
And just to head off any potential requests, I will not distribute my modified version of MF’s plugin unless MF gives me explicit permission to do so. I suspect MF would rather release an official updated version of the plugin rather than have an unofficial version get into the wild.
There’s a difference between category names and category ID’s. In EE, category names are not unique, whereas category id’s are. I’ve discussed this with Mr. Wilson and he agrees that this could cause conflicts. We think that the only way to avoid them would be, to manually ensure that you use unique category names. Since I don’t want to rely on this, I’ve decided not to add Mr. Wilson’s first suggested code to this plugin.
However Mr. Wilson then came up with another solution/approach, using segments to identify even duplicate category names.
Example: http://example.com/index.php/categories/category_name/subcat_name/subsub_name/
He might want to share it with you. So that you can add those changes to the plugin.
mediagirl,
Check your inbox. I sent you an e-mail.
Folks who want to see my modification of MF’s plugin in action can visit http://lincolnite.com/directory/. The website is a work-in-progress.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.