I think overriding Page#find_by_url for the /blog page would be the answer. In the override (which I would probably add with alias_method_chain), I would do two things:

1) Attempt to find the page normally by calling the overridden method.
2) If the normal find_by_url returns nil or a FileNotFoundPage, attempt to find the page by slug as a child of the /blog/archive page (more precisely, select the ArchivePage from /blog's children, then find among its children by slug, excluding virtual pages). If this returns nothing, then pass through nil or the FileNotFoundPage; otherwise return the found grandchild page.

Hope that gets you going in the right direction.


Nathaniel Talbott wrote:
I have a client who wants to shorten the blog permalinks on their site from:


The blog is set up in the standard Radiant manner, and I'm scratching
my head over how to get these links working how they'd like them to. A
few requirements: /blog/archives should still be an archive page, and
/blog still needs to show the most recent five posts (and thus I don't
think it can be the archive page itself).

Any pointers on the simplest way to get this working? If I need to
write a some custom tags that's fine, but I wanted to make sure I'm
not missing a simpler solution first.


Radiant mailing list

Reply via email to