Hi, I'm looking for advice on how best to implement a plugin that contains some CSS. I would like the CSS to be automatically added to any layout so that the only action I need to perform is installation of the plugin. Is this possible? The reason for this is that the plugin includes some view partials and I want to provide default stylesheets so the partial's contents look reasonable by default. If application-specific styling is then required the styles would be customised by overriding in a controller's style sheet outside the plugin. I assume I will need a stylesheets folder in the plugin and have the plugin installer copy any stylesheets into the application's public folder. What I don't know is how I can have that stylesheet applied automatically. They way I do this now is to use a helper in the layout to include the stylesheet but I'd like to avoid that. I have used the Styler plugin to help manage css before and it's quite good. I could customise that to include plugin css in its search. But is there a better way to achieve this? Thanks!
on 2010-03-05 11:05
on 2010-03-09 22:25
John Lane wrote:
> Would anyone be able to help with my query?
I'd say monkey patch the view helpers to inject your own code (css, js,
whatever) in it.
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.