I’m creating a site map for a clients site. I want to be able to use the category_archive function, since this allows for new categories to be added overtime without my interference. The issue I’m having though is specifying the article location within the site map.
Currently, I have
{exp:weblog:category_archive weblog=“log” backspace=“6”}
{categories}
<h3>{category_description}</h3>
{/categories}
{entry_titles}
<a href=”{path=log/article}”>{title}</a><br />
{/entry_titles}
{/exp:weblog:category_archive}
Since in my system, each category has an associated template group, what I’d like to see is the path=log/article replaced with the category name. So for category one path would be path=one/article, path=two/article etc.
Basically, what I want is so that the EE Query might look something like this (this code doesn’t actually work)
{exp:weblog:category_archive weblog=“nahic” backspace=“6”}
{categories}
<h3>{category_description}</h3>
{/categories}
{entry_titles}
<a href=”{path={categories}/article}”>{title}</a><br />
{/entry_titles}
{/exp:weblog:category_archive}
This would then create a list like so:
<h3>Adolescent Health Data</h3>
<ul><li><a href=“http://nahic.ucsf.edu/index.php/data/article/adolescent_health_report_card/”>Adolescent Health Report Card</a><br />
</li>
<li><a href=“http://nahic.ucsf.edu/index.php/data/article/americas_adolescents_are_they_healthy_2003/”>America’s Adolescents: Are They Healthy? (2003)</a><br />
</li></ul>
<h3>Tools for State & Local Programs</h3>
<ul><li><a href=“http://nahic.ucsf.edu/index.php/tools/article/adolescent_health_tool/”>Adolescent Health Tool</a><br />
</li></ul>
Where the <h3> tag displays the category description or in my case the proper category name, but then the path displays the actual category (which matches the template name), in this case first “data” then “tools” respectively.
Is it possible to display the pulled “category_name” as part of the article path?? Has anyone come up with a DYNAMIC solution for this?
The only other option I can think of is to pull each category independently, which works ONLY until a new category comes along, then the template code would need to be changed.
