ZenphotoCMS Forum
How do you load a plug-in's CSS? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: Plugins (https://forum.zenphoto.org/forum-6.html)
+--- Thread: How do you load a plug-in's CSS? (/thread-6182.html)



How do you load a plug-in's CSS? - micheall - 2009-11-24

Ok, I thought I had it nailed down, but recently while checking out the pages with firebug I noticed that the CSS isn't actually being loaded like I thought it would be.

So perhaps I'm missing this somewhere? Here's my current code-call for it.
function zenTwitterToCSS() { $css = USER_PLUGIN_FOLDER . '/zenTwitter/zenTwitter.css'; $link_css = ''; return $link_css; unset($css,$link_css); }
Edit:

Nevermind, another tired night and missed an obvious problem, the lack of use of echo on the variable.




How do you load a plug-in's CSS? - acrylian - 2009-11-24

If you want to automatically add that into the head of the page you can also use addPluginScript('...'). See the flowplayer3 plugin for an example.




How do you load a plug-in's CSS? - micheall - 2009-11-25

Thanks for that tip acrylian! Much easier to do it that way, and one less edit that an end-user would have to do to use it. Much appreciated.