List of Blog Categories

Author: Webvanta

Lists all of the blog categories, if any. Blog categories are assumed to be subcategories of the top-level category "Blog"; if that top-level category does not exist, the list is not shown.

If there are no posts in a category, it is not listed.

This is in the snippet "blog_categories" in new sites.

<h3>Categories</h3>
<w:kb:category name='Blog'>
  <!-- if there are any categories within the blog  category, display the content below -->
  <w:if_category>  
    <ul>
         <!--  iterate through each  category that is a child of the blog category -->
        <w:each relative='children'> 
           <!--  if the category contains  any posts:  -->
          <w:if_items  category='current' type='posts'> 
            <li <w:if_current>class='current-category'</w:if_current>>
              <!--  
                 display a link to the blog category page. 
                 url  refers to a category page; in the case /bp/blog-category 
              -->
              <a href='<w:path  url="/blog-category" />'><w:name /></a>                
            </li>
           </w:if_items>
        </w:each>
    </ul>
  </w:if_category>
</w:kb:category>