You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by Jameson Watkins <JW...@kumc.edu> on 2005/10/26 15:44:38 UTC
Listing category in entry
Hi, quick question from a roller newbie.
I'm setting up our environment and would like to display the category
each post is in. I can't find a velocimacro on the wiki site to display
this, although I see it on a number of roller blogs. It may be that I
don't understand the syntax of the showWeblogEntriesInCategory. Here's
the format I'm looking for:
Blog Entry 1
[permalink] [category]
I'm using roller 1.2.
Thanks.
Jameson Watkins
Director, Internet Development
University of Kansas Medical Center
http://www.kumc.edu/
913-588-7387
Re: Listing category in entry
Posted by Dave Johnson <da...@rollerweblogger.org>.
You should be able to use $entry.category.name to get the category name.
- Dave
On Oct 26, 2005, at 9:44 AM, Jameson Watkins wrote:
> Hi, quick question from a roller newbie.
>
> I'm setting up our environment and would like to display the category
> each post is in. I can't find a velocimacro on the wiki site to display
> this, although I see it on a number of roller blogs. It may be that I
> don't understand the syntax of the showWeblogEntriesInCategory. Here's
> the format I'm looking for:
>
> Blog Entry 1
> [permalink] [category]
>
> I'm using roller 1.2.
>
> Thanks.
>
>
> Jameson Watkins
> Director, Internet Development
> University of Kansas Medical Center
> http://www.kumc.edu/
> 913-588-7387
>
Re: Listing category in entry
Posted by Anil Gangolli <an...@busybuddha.org>.
This is not governed by showWeblogEntriesInCategory, but rather what
you do in the day template (typically _day.vm).
You probably have something like a #foreach ($entry in $entries) loop in
your _day.vm.
Within that loop, for a given $entry, the category name is accessible as
$entry.category.name. So basically
"[$entry.category.name]" in the right place should give you what you
want. If you want that to be a link to the full category,
that's also possible and here's a little macro I use on my blog:
#**
* Display the entry category as a link with class entrycategorylink
*#
#macro( showEntryCategoryLink $entry )
<a
href="$baseURL/page/$userName/Weblog?catname=$utilities.encode($entry.category.path)"
class="entrycategorylink">
[$entry.category.name]
</a>
#end
Jameson Watkins wrote:
>Hi, quick question from a roller newbie.
>
>I'm setting up our environment and would like to display the category
>each post is in. I can't find a velocimacro on the wiki site to display
>this, although I see it on a number of roller blogs. It may be that I
>don't understand the syntax of the showWeblogEntriesInCategory. Here's
>the format I'm looking for:
>
>Blog Entry 1
>[permalink] [category]
>
>I'm using roller 1.2.
>
>Thanks.
>
>
>Jameson Watkins
>Director, Internet Development
>University of Kansas Medical Center
>http://www.kumc.edu/
>913-588-7387
>
>
>
>