Re: Setting depth with the flav_config plugin

Stuart Langridge <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
will guaraldi wrote:
> On Sat, 4 Dec 2004, Stuart Langridge wrote:
>> I thought you might say that, and I have contacted the plugin author. 
>> However, I'll then ask a more general question: where in the callback 
>> chain should I insert a plugin which can limit the "depth" setting on 
>> a directory-by-directory basis?
> 
> Mmm...  You could do it in the filelist callback.  The Request object 
> gets passed in and you could modify the depth config property in-place.
> 
> Alternatively, you could register with the prepare callback and filter 
> the filelist at that point rather than changing the depth property.

Calling it from cb_filelist works fine. I have one additional problem: 
with the depth limited to 1 in a directory, if there are no entries in 
that directory then I get the "The page you are looking for is not 
available" thing from the renderer. This doesn't seem to be 
overrideable: cb_prepare runs before that gets called, and if there are 
no entries in the list then the "The page you are looking for is not 
available" message is displayed. I suppose I could throw a fake entry 
into entry_list from cb_prepare, but that seems really crufty. How 
should I get around this? I suppose I could also write a new renderer 
that knows to ignore that message, but that seems like a lot of work!

sil


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.