You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by jo...@johnmercier.com on 2009/12/20 04:17:56 UTC
Viewing categories
Hello everyone,
I'm slowly working on my own theme and I want to do a few things that I
can't figure out.
I was wondering if it is possible to filter out a category of entries from
the main weblog. I want to display that category in a separate template. I
also want to customize the _day template that the category page uses for
each day.
So, for example, I want to filter out all entries in the category "Main
Projects" from here
http://www.johnmercier.com/roller/
and only display that category here
http://www.johnmercier.com/roller/moaxcp/page/projects
and I want to customize the _day template to get rid of the header and
footer of the entry.
I hope this makes sense to everyone.
Thanks!
Re: Viewing categories
Posted by Horatia <ro...@gmx.info>.
Has no one an answer on this important question?
Horatia
-------- Original-Nachricht --------
> Datum: Sat, 19 Dec 2009 22:17:56 -0500 (EST)
> Von: john@johnmercier.com
> An: user@roller.apache.org
> Betreff: Viewing categories
> Hello everyone,
>
> I'm slowly working on my own theme and I want to do a few things that I
> can't figure out.
>
> I was wondering if it is possible to filter out a category of entries from
> the main weblog. I want to display that category in a separate template. I
> also want to customize the _day template that the category page uses for
> each day.
>
> So, for example, I want to filter out all entries in the category "Main
> Projects" from here
>
> http://www.johnmercier.com/roller/
>
> and only display that category here
>
> http://www.johnmercier.com/roller/moaxcp/page/projects
>
> and I want to customize the _day template to get rid of the header and
> footer of the entry.
>
> I hope this makes sense to everyone.
>
> Thanks!
Re: Viewing categories
Posted by Dave <sn...@gmail.com>.
On Sat, Dec 19, 2009 at 10:17 PM, <jo...@johnmercier.com> wrote:
> I was wondering if it is possible to filter out a category of entries from
> the main weblog. I want to display that category in a separate template. I
> also want to customize the _day template that the category page uses for
> each day.
>
> So, for example, I want to filter out all entries in the category "Main
> Projects" from here
>
> http://www.johnmercier.com/roller/
>
> and only display that category here
>
> http://www.johnmercier.com/roller/moaxcp/page/projects
>
> and I want to customize the _day template to get rid of the header and
> footer of the entry.
The macros that are built into Roller do not allow you to filter out a
category. So, if you want to do this you'll have to write a little
Velocity template code. Instead of using #showWeblogEntriesPager() you
would write some Velocity code.
For example, you might create a special day template that omits
entries in a filter category. Then use some code like this to invoke
it:
## get pager for entries specified by URL
#set($pager = $model.getWeblogEntriesPager())
## get special day templaet
#set($dayPage = $model.weblog.getPageByName("mySpecialDayTemplate"))
## get entries map
#set($map = $pager.getEntries())
## foreach day of entries, run your day template
#foreach($day in $map.keySet())
#set($entries = $map.get($day))
#parse($dayPage.id)
#end
Hope that helps...
- Dave