roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jennifer Oxelson <oxel...@unidata.ucar.edu>
Subject Re: Display subcategory entries when parent category is selected.
Date Sat, 26 Mar 2011 18:11:39 GMT
Here is a way to do this (it may be a bit of a hack, but it works):

In your weblog.vm file, you will want to modify the $entries that gets 
sent to the _day page to be conditional upon if a category is being 
displayed:

        #set($pager = $model.getWeblogEntriesPager())
        #set($dayPage = $model.weblog.getPageByName("_day"))
       
        #if($model.weblogCategory)
            #set($entries = 
$model.weblogCategory.retrieveWeblogEntries(true)) 
            <h2>Entries for: $model.weblogCategory.name</h2>
            #parse($dayPage.id)
        #else
            #set($map = $pager.getEntries())
            #foreach($day in $map.keySet())
                #set($entries = $map.get($day))  
                #parse($dayPage.id)
            #end
        #end

Also, be sure to assign $day to the entry date in _day if you reference 
it anywhere.

Hope this helps...




> Dave wrote:
> > 
> > You must have missed my earlier response:
> >    http://markmail.org/message/wn3d2zczmtm5zacf
> > 
> > On Mon, Jun 8, 2009 at 2:07 PM, Eric Schmidt<eschmidt@lssaa.wisc.edu> wrote:
> >> Hello,
> >>
> >> I am trying to get entries placed in a subcategory to be shown when a
> >> visitor views a top-level category.  So, for example, if a user clicked on a
> >> link for the Category /Sports, they would see all posts with that category,
> >> along with posts in /Sports/Football, /Sports/Baseball, etc.  Is something
> >> like this possible?
>
>
> Was wondering if anyone has finally done this either by template 
> programming or the java full monty with pagers and such?
>
>
> -- 
> Manos Batsis, Chief Technologist
>   

Mime
View raw message