On Mar 12, 2007, at 7:26 PM, Daniel Sheppard wrote:
> I've taken the approach of having a separate table mapping urls to
> page numbers and a file not found behaviour that performs
> redirects for old mappings (I also trawl through my server logs for
> 404s and correct any repeated spelling mistakes / truncations) -
> I've left it as a separate table that I maintain by hand so as not
> to confuse the page tree.
>
> http://soxbox.no-ip.org/radiant/svn/extensions/x_groggy/app/models/
> groggy_file_not_found_page.rb
That rocks. It would be great if you could make that a separate
extension with an interface to manage the redirect table. (Hint,
hint. ~_^)
> (Note that I also had to have a custom index page so that it could
> look at my custom file not found type).
Wouldn't something like this in core be better? (COMPLETELY UNTESTED)
----- 8< -----
Index: page.rb
===================================================================
--- page.rb (revision 352)
+++ page.rb (working copy)
@@ -135,7 +135,8 @@
return found if found
end
end
- children.find(:first, :conditions => "class_name =
'FileNotFoundPage'")
+ not_found = Object.subclasses_of( FileNotFoundPage ) +
['FileNotFoundPage']
+ children.find(:first, :conditions => ["class_name IN (?)",
not_found])
end
end
@@ -251,4 +252,4 @@
end
----- 8< -----
~~ Brian
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant