Technical capabilities of plugins vs themes?

17 views
Skip to first unread message

Douglas Duhaime

unread,
Jun 30, 2016, 8:30:49 AM6/30/16
to Omeka Dev
Hello, I'm trying to better understand the technical capabilities of plugins and themes, so I can better understand the limits of each and can tell when each is appropriate.

I thought for instance one could only define custom controllers in plugins, but is it possible to do so in themes as well? Is it possible to create controllers, custom routing, etc in themes? 

I'd be grateful for any advice you can offer on this question!

John Flatness

unread,
Jun 30, 2016, 10:28:49 AM6/30/16
to Omeka Dev
Your initial understanding was pretty much right: if you're adding a controller, that's a job for a plugin, not a theme.

Themes mostly just provide customized versions of the "views" files from the core and plugins, that's their main purpose. You can stretch the boundaries of what a theme can do a little bit by using a custom.php file which lets you provide code that gets executed on every pageload, but that won't get you as far as adding controllers or things like that.

-John

Douglas Duhaime

unread,
Jun 30, 2016, 12:06:45 PM6/30/16
to Omeka Dev
Thanks so much John! 

I didn't realize that the functions defined in custom.php are called every page load--this is very good to know. Thanks again for your assistance. 
Reply all
Reply to author
Forward
0 new messages