Re: num_entries should not apply to category views
chombee <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <1207222854.5449.1.camel@marley> |
On Wed, 2008-04-02 at 19:50 -0400, will wrote:
> I'm coming from the point of view of "what should a default PyBlosxom
> installation without any plugins do" and "how can we implement this so
> that it's convenient to modify the behavior with plugins"?
>
>
> I think I'm of the mind that a default PyBlosxom installation with no
> plugins should work like this:
>
> * root page shows num_entries number of entries
>
> * paths that start with a date (date-based archives) or category
> (category-based archives) show all entries that fall in that archive
> (i.e. no num_entries truncating)
>
>
> This allows archives access like chombee is suggesting (which while I
> wouldn't want it on my blog, it seems decent). The only problem is that
> entries in the root category past the num_entries point will only be
> accessible by date-base archives, but I'm not sure I care about that much.
>
>
> PyBlosxom 2.0 (still in development) has a truncatelist callback which
> makes it trivial to modify the truncation behavior with plugins.
>
> For example, if we mark the paths that we consider to be archives (which
> I think is a good idea in light of this conversation), then we can
> implement truncation of archives with a plugin like this:
>
> def cb_truncatelist(args):
> req, entry_list = args["request"], args["entry_list"]
>
> if req.data.get("archives", False) and \
> req.config.get("num_entries", 0):
> return entry_list[:req.config["num_entries"]]
>
> Variations on that are also possible. I imagine I'll use the
> truncatelist callback in wbgpager to modify the truncation behavior if I
> haven't already done so--it'd be easier than the num_entries munging I
> originally wrote.
>
> Does that setup cause problems?
This looks good to me.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace