Re: A Breadcrumb in PyCategories
Wari Wahab <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <1060383507.687.17.camel@async> |
On Fri, 2003-08-08 at 15:27, Joseph Reagle wrote: > I was thinking that it'd be nice to have the category you are presently in > highlighted. At first I was thinking of using the CSS trick of "body id" > [1], but don't think I can do get the to different plugins to emit > consistent IDs and accomplish the trick with a static CSS a priori... Then > I figured if I could just get PyCategories to emit a 'class="selected"' on > the category you are in presently, that would be useful. But, I don't think > PyCategories has access to that information (I looked in > self._request.getConfiguration()). And I don't understand the plugin > architecture well enough to know if I could get to the two plug-ins to > cooperate, or whether that's a good idea architecturally. > > So just an idea that perhaps someone else would know how to accomplish > easily. What ever plugin you are talking about, it is easy to get the data you need from the Request.getData()[path_info] and calculate what you need from that variable. So if your request is /foo/bar/spam.html, data['path_info'] would contain ['foo', 'bar', 'spam.html']. That is what breadcrumbs should use, but I'm lazy to change that (if breadcrumbs becomes too popular and people start mocking at how ugly it is :) So there. For plugins to share information with each other is quite easy, really. Plugins could load other plugins as modules, either use their functions, or read the globals off them. In the blosxom world, plugins do that. In pyblosxom, the comments family of plugins shares the write_comment() function provided by the comments.py. pingback.py would import comments.py and call write_comment(), no need to have seperate functions doing the same thing. ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01