Use Existing Theme for a View in a Plugin

I’m working on an Omeka plugin. I have an action that renders a view, but I want that view to use an existing custom theme. Hopefully that makes sense. Any suggestions? I have to image there’s some way to grab the custom.php script of that theme and some how load it in the Controllers action, but I’m having trouble figuring that out.

I’m not sure what you mean. Any public view will “use” the current theme. You want to use a custom function defined by the theme?

Yeah. So we have a custom theme we created for an exhibit. My plug-in defines routes to a custom page with no theme. I’m trying to use that other custom theme (that’s in the themes directory) with this page that’s created through the plug-in.

To clarify, right now my custom defined route has no common files (so no header or footer). I’m trying to add those from an existing theme. So I define a route and the body is showing up the way I want (from a view), but I want the head, header, and footer to come from an existing theme.

I’ve tried set_theme_url, set_theme_option, get_theme_option. Nothing seems to be working.

I’ve managed to get the header and footer to show up but adding head() and footer(). But it’s using the default public theme. Is there a way to choose a different theme for the specific route that I’m creating in the plug-in?

If you’re looking to change the theme in use for some particular page, then the public_theme_name filter is your basic option.

You’d get the request:

$request = Zend_Controller_Front::getInstance()->getRequest();

Then check on that if you’re in your module, controller, and action that you want to change, if so return the name of your custom theme, otherwise return the original one unchanged.