View partials and CSS


For a plugin I’m creating, I have a rather complex form that I intend to use in several pages (to add and edit some info for example).
I was planning to use the form as a view partial, but this prevents me from including the associated CSS using either queue_css_file or a <link> tag, since these need to be in the header.

Other solutions would be to use queue_css_file in every page that includes the form (but it’s not that practical), or to use a <style> tag inside of the form (which I don’t really like).

I’ve only used Omeka for a month, so is there another option I could have missed ?

You can use the public_head (or admin_head, if this is the admin) hooks to run those queue functions… the simple case of just including it always will work of course, or if it’s say, everything under your module or something like that, you can test that kind of thing against the request object to decide when to queue your sheet.