
Donna
Staff
/ Moderator

Jan 2, 2007, 5:21 PM
Post #2 of 12
(4997 views)
Shortcut
|
Hi diness! This is a little complicated, but I was able to make it work for you. :) What we'll end up doing is basing this on the Grouped by Headlines rules that create the default headlines on the right side of the global index page. Right now, this does almost exactly what you're looking for, except it doesn't show the sub-categories, only the top-level cats. Here's how! 1. First, we'll make a copy of two templates, so you can adjust the look & feel of each (and some other minor changes). The two templates you'll be modifying are: /templates/categoryMenus/groupedHeadlines.html /templates/articleLists/articlesForGroupedHeadlines.html I made copies of these called: /templates/categoryMenus/sitemapHeadlines.html and /templates/articleLists/articlesForSitemap.html Leave them as is for now, we'll come back and modify them in a minute. 2. Next, make a copy of the Grouped Headlines publish rule. To do this, click modify for the "Grouped Headlines (grouped by category)" publish rule, and scroll down to the bottom until you see the "Copy Rule" button on the left hand side. Click Go, and you'll have a new rule that you can start modifying immediately. Make the following changes to the new rule: - Update the name - I changed the name of mine to "Site Map" to make it easy to keep track of. - Change the template to use the one that you created a minute ago. You can select this from the dropdown list. (sitemapHeadlines.html) - Modify the placeholder to something different. (I used "sitemap") - Modify the filename so that it's not overwriting the default headlines. I called mine sitemap <ext> -- by default, this will publish to your main publish directory, as sitemap.shtml - Scroll to the bottom and change the Menu Format to "Show All". Then save. 3. Next, we'll make a copy of the Articles for Grouped Headlines publish rule. Make the following changes: - Choose different names (including the placeholder set name -- I changed mine to sitemaparticles) as before - Choose the new template from the dropdown menu. (articlesForSitemap.html) - Change the "Limit Results" section to show as many as you want. (If you want all of your results to show, set the second number to something very high, like 1-1000.) - Under "Advanced Options" and uncheck the box that says "Include articles from subcategories". Then save. 4. Now we'll get back to those templates. :) Open the categoryMenu template we modified earlier (I called mine sitemap.html). Here's what I used as the content:
<!-- template insert : $categoryList$ --> <!-- templatecell : categoryRow --> <!-- templateIf : $category.depth$ == "0" --> <strong>$category.name$</strong><br> <!-- /templateIf --> <!-- templateIf : $category.depth$ == "1" --> $category.name$<br> <!-- /templateIf --> <!-- templateIf : $category.depth$ == "2" --> $category.name$<br> <!-- /templateIf --> <!--#include virtual="$published.sitemaparticles.webpath$" --> <!-- /templatecell : categoryRow --> You can, of course, format this as needed -- I've set mine to be pretty barebones for demonstration purposes. I'd recommend starting with this -- you can come back later and format it to fit your look & feel. For the second template (the articlesForSitemap.html), I trimmed it down to just this:
<!-- template insert : $articleList$ --> <!-- templatecell : articleRow --> <a href="$published.articlePage.url$">$article.title$</a><br> <!-- /templatecell : articleRow --> Again, you format it as needed later. Save both templates. 5. Now, go back to the admin.cgi and click Publish All to republish your site, and take a look at the published file. :) If you used my naming scheme, it will be at something like http://www.yoursite.com/artman/publish/sitemap.html -- otherwise, go to whatever you set the filename to be. Let me know if that works for you, or if you have any other questions or concerns! Donna -- support@interactivetools.com
|