Dashboard > blojsom 3.0 > ... > Plugins > Entries per Category Plugin
  blojsom 3.0 Log In   View a printable version of the current page.  
  Entries per Category Plugin
Added by David Czarnecki, last edited by David Czarnecki on Apr 04, 2007  (view change)
Labels: 

Availability

blojsom 3.2

Description

Counts the number of entries for the categories within a blog.

Installation and Setup

In your /WEB-INF/classes/blojsom-plugins.xml file, add the following:

<bean id="entries-per-category" class="org.blojsom.plugin.common.CountEntriesForCategoryPlugin" init-method="init" destroy-method="destroy">
        <property name="fetcher">
            <ref bean="fetcher"/>
        </property>
    </bean>

You may then add "entries-per-category" to one of the flavor-based plugin chains.

Usage and URL Parameters

Context Attributes and Types

The following table describes the context attributes that are available and their associated type.

Context key Input or Output Type Description
PLUGIN_ENTRIES_PER_CATEGORY Output java.util.Map Keys are the category ID (Integer) and the value for a given key is an Integer of the # of entries for that category ID.

Usage

In looping through your categories, you can include some template code such as the following Velocity code to display the number of entries in a category:

($!PLUGIN_ENTRIES_PER_CATEGORY.get($category.getId()))

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators