Description
Allows you to retrieve entries by category, flavor, or a specific entry from your templates.
Availabilty
Available as of blojsom 2.24.
Installation and Setup
In your global /WEB-INF/plugin.properties file, add the following line:
fetcher-helper=org.blojsom.plugin.fetcher.FetcherHelperPlugin
You may then add "fetcher-helper" to one of the flavor-based plugin chains. These plugin chains can be found in the individual blog's plugin.properties file. For example:
html.blojsom-plugin-chain=..., fetcher-helper
Usage and URL Parameters
You can then use the following in your template:
$BLOJSOM_PLUGIN_FETCHER_HELPER.fetchEntriesForCategory(categoryName, entriesLimit)
$BLOJSOM_PLUGIN_FETCHER_HELPER.fetchEntriesForFlavor(flavor, entriesLimit)
$BLOJSOM_PLUGIN_FETCHER_HELPER.fetchPermalink(categoryName, permalink)
entriesLimit is an int. Use -1 to retrieve all entries otherwise it limits the
number of entries returned using the given value.
You can use this in, for example, the Velocity templates:
#set($entriesFromCategory =
$BLOJSOM_PLUGIN_FETCHER_HELPER.fetchEntriesForCategory('/test', 5)
#set($entriesForFlavor =
$BLOJSOM_PLUGIN_FETCHER_HELPER.fetchEntriesForFlavor('rss2', -1)
#set($specificEntry = $BLOJSOM_PLUGIN_FETCHER_HELPER.fetchPermalink('/test', 'some_blog_entry.html'))
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 |
| BLOJSOM_PLUGIN_FETCHER_HELPER |
Input |
org.blojsom.plugin.fetcher.FetcherHelperPlugin.FetcherHelper |
Various methods on this object exist to retrieve entries by category, flavor, or for a specific entry. |