On 1 Feb 2011, at 15:50, D.Kreft wrote: > On Tue, Feb 1, 2011 at 6:43 AM, William Ross <w...@spanner.org> wrote: > > I don't use the archive extension but my feeling here is that the logic in > the model is right and your url scheme is twisting things a bit out of shape. > Any reason not to use /events/city/YYYY/MM/DD? Then the slug constraint would > be helping you as it's meant to. It may just be a case of creating a page for > each city. > > If I use the scheme you're suggesting (and I have thought of it), it would > lead to longer urls and it still wouldn't solve the problem. The scheme we > use is more like: > > /apac/seminars/2011/02/01/beijing > /apac/workshops/2011/03/02/beijing > > Turning this upside-down would require adding another directory (e.g. events) > to maintain a sane IA, and would make the urls look like: > > /apac/events/beijing/2011/02/01/seminar > /apac/events/beijing/2011/03/02/workshop
If I was trying to give it a sane IA I wouldn't publish the calendar using a blog-history extension in the first place :) I do think there's an architectural flaw in the Archive extension: I would be inclined to interpolate the date string in the slug method (rather than in child_path) so that at validation we see the path that is actually used. This is very old code, though, carried forward mostly for compatibility reasons. I doubt that people will be keen to make fundamental changes, but I could well be wrong. The slug is a more monkeypatchable change so you might be able to do it from the outside just by overriding child_path and slug. It probably depends how much use you are making of ArchiveMonthPage and the like. > But this still doesn't solve the problem because as soon as we want to host > another seminar or workshop in Beijing, we're right back to square > one--Radiant is going to whine about duplicated slugs. The other obvious change is just to make your slugs different. beijing2 or beijing_june, say. You can still have 'Beijing' in page title and breadcrumb. ? best, will