I have been having hard time modifying Blojsom's templates to get the Internal Aggregator plug-in to work. I wish there were a concrete example or a tutorial for me to follow. Today I googled again after a desperate fight with Blojsom and fortunately came across Todd Slater's posting.
Mr. Slater posted his working copy of the template files. I downloaded, put it in to the template folder right away. And...it works!
I'll be studying how he wrote the template very soon. But in the mean time, thank you very much Mr. Slater!
Keywords: blojsom, aggregation, customization, examples
Update: Jan 5, 07
Here's the difference between my
Mine looks like this:
Then
Mr. Slater chose not to use the macro and his code looks like this:
Mine doesn't work but Mr. Slater's works. So I guess there must be something wrong with this rather complicated use of macro. Perhaps, it is the limitation of Velocity which is the template engine used by Blojsom. It is most likely that the
Update: Jan 6, 07
I looked at Mr. Slater's code and saw references to the
I finally found its definition in Blojsom source folders.
Mr. Slater posted his working copy of the template files. I downloaded, put it in to the template folder right away. And...it works!
I'll be studying how he wrote the template very soon. But in the mean time, thank you very much Mr. Slater!
Keywords: blojsom, aggregation, customization, examples
Update: Jan 5, 07
Here's the difference between my
asual-entry.vm
and Mr. Slater's:Mine looks like this:
#macro(multiBlogFriendlyPermalink $entry)
macro definition at the top of the file. #macro(multiBlogFriendlyPermalink $entry)
#set ($categoryForEntry =
$entry.getBlogCategory().getCategory())
#if ($categoryForEntry == "/")
#set($categoryForEntry = "")
#end
#set ($entryLink =
$entry.getMetaData().get(
"BLOJSOM_PLUGIN_INTERNAL_AGGREGATOR_BLOG_URL")
$categoryForEntry$entry.getDateAsFormat("yyyy")/
$entry.getDateAsFormat("MM")/
$entry.getDateAsFormat("dd")/
$entry.getPermalink()")
#end
Then
#multiBlogFriendlyPermalink($entry)
#set($permalink = $entryLink)
...
<a href="$entryLink">
...
Mr. Slater chose not to use the macro and his code looks like this:
<a href="$entry.getMetaData().get(
"BLOJSOM_PLUGIN_INTERNAL_AGGREGATOR_BLOG_URL")
$categoryForEntry$entry.getDateAsFormat("yyyy")/
$entry.getDateAsFormat("MM")/$entry.getDateAsFormat("dd")/
$entry.getPermalink()")">
Mine doesn't work but Mr. Slater's works. So I guess there must be something wrong with this rather complicated use of macro. Perhaps, it is the limitation of Velocity which is the template engine used by Blojsom. It is most likely that the
#set
assignment breaks when it has a very long right-hand-side argument. I removed calls to the multiBlogFriendlyPermalink
macro and now use Mr. Slater's style. It works!Update: Jan 6, 07
I looked at Mr. Slater's code and saw references to the
$categoryForEntry
variable. I can't find any #set($categoryForEntry = ...)
assignment in his code, which oppose mine being defined in the #macro(multiBlogFriendlyPermalink $entry)
macro definition. Therefore, $categoryForEntry
must be a predefined variable, I think.I finally found its definition in Blojsom source folders.
$categoryForEntry
is defined in plugins/src/org/blojsom/plugin/admin/templates/
admin-macros.vm
and plugins/src/org/blojsom/plugin/
velocity/page-macros.vm
. It is deployed at the same paths inside WEB-INF/lib/blojsom-plugins-templates-2.32.jar
.
Comments