Re: handling 404
"Sebastian Spaeth" <[email protected]> Tue, 15 Jun 2010 10:51:11 +0200
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <[email protected]> |
On 2010-06-14, will kahn-greene wrote: > A month or two ago someone asked on #pyblosxom about how to get > PyBlosxom to do something different when faced with a 404 situation. > I was thinking about creating a callback. PyBlosxom would do its thing > and then at the point where it's about to throw an HTTP 404, it would > call this 404 handling callback. Plugins could implement the callback > and do whatever. If no plugins handle the callback, then PyBlosxom > would default to doing what it does now: create a fake "No entries by > that name" kind of entry and render it in a story template. > Is it sufficient for the 404 handling plugin to return a fake entry that > gets rendered in the blog's theme with navigation links and bars and all > that? This fake entry could override which template to use. I think that would be good, a fake entry overriding the template sounds like a good thing to me. It is simple enough, yet powerful. > Are there other situations (500? 403? ...) that would want to get > handled in a similar way such that we'd want to abstract this into > something more general? If you create a callback, why bot make it a cb_error that hands over the error code? A call back could then -based on the error code- decide if it wants to handle it and return "True" if it handled it and "False" if it did not. Then you could go through all plugins until the first one handled our case. I don't know use cases for anything else but 404 at the moment, but I am sure that could come in handy. Sebastian ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Pyblosxom-devel mailing list Pyblosxom-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/pyblosxom-devel
signature.asc
(application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkwXPwAACgkQVYX1jMgnoGInEQCfSZ71GzPnSXFSWDf93fkrDEBe bgUAni23PqZx2UhLYVdBQGE3hm4SO3sj =+Xpq -----END PGP SIGNATURE-----