Hi,
You won't be able to use the 'browse_items' hook to modify your
routes, because routes are loaded / matched way back at the beginning
of the request. The Zend Framework site has a ton of documentation on
their particular implementation of MVC, but the basic gist is that
routing is one of the first things that happens in any given request.
The application matches your URL against the list of defined routes
and then uses that to parse out the parameters. It doesn't know you
are trying to browse the items until *after* the browse items route
has been matched against the current URL, meaning modifying the routes
after the matching process won't change Omeka's behavior.
That said, you should try using the 'define_routes' hook that I
mentioned previously. That receives the router as the first argument
($router), so you don't need to (and shouldn't) create a new instance
of the RewriteRouter.
Other than that, you've got the correct method call to add routes,
$router->addRoute($name, new Zend_Controller_Router_Route); but you'll
need to tweak your routes to get that working. I'm not totally clear
on how to make your routes match properly, but that seems to me to be
the heart of the problem you are trying to solve. The easiest way to
see whether your routes are being matched properly is to edit the
config.ini file and set debug.request = true. Then open the URL that
you think should be matched, e.g. items/browse/format/photograph or
something like that, and Omeka will dump the request object to the
screen, so you can check if the correct controller/action and
parameters were matched.
Hope that helps!
Kris
> For more options, visit this group at
http://groups.google.com/group/omeka-dev?hl=en
> .
>
>