Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How can i overload plugin css files in my theme?

edited September 2009 in Vanilla 2.0 - 2.8
I have installed the 'whosonline'-Plugin, which has a 'whosonline.css' file in the plugin directory.
Is it possible to replace that file for my theme by copying it in my theme folder? (like the vanilla.css or garden.css described on the Theme Quick Start docs page)


  • SS ✭✭
    No. Application's CSS file is added by Controller::AddCssFile(). But plugin using Controller::Head::AddCss()
  • Thanks for installing my plugin, hope it works okay. :)
    As S said i believe you need to keep it where it is.
  • SS ✭✭
    edited September 2009
    > How can i overload plugin css files in my theme?

    Possible I have solution for your problem.

    Put all content of whosonline.css in /themes/yourtheme/design/garden.css (add to the end) and override CSS values as you want. If it will work well, send a word about that.
  • You can use the
    color: #FFFFFF !important;

    Which should override some of the stuff if u follow S's
  • lucluc ✭✭
    Plugin doesn't use css file anymore, otherwise you could have placed a file with the same name in the design folder, and it would have picked it up automatically if the css was added with AddCssFile, and not with a full path name.

    That's the case (full path) for some core plugin :

    Debugger/default.php: $Sender->AddCssFile('/plugins/Debugger/style.css');
    Emotify/default.php: $Sender->AddCssFile('plugins/Emotify/emotify.css');
    Flagging/class.flagging.plugin.php: $Sender->AddCssFile('admin.css');
    Flagging/class.flagging.plugin.php: $Sender->AddCssFile($this->GetResource('design/flagging.css', FALSE, FALSE));
    Flagging/class.flagging.plugin.php: $Sender->AddCssFile($this->GetResource('design/flagging.css', FALSE, FALSE));
    GettingStarted/default.php: $Sender->AddCssFile('plugins/GettingStarted/style.css');
    Tagging/class.tagging.plugin.php: $Sender->AddCSSFile('plugins/Tagging/design/token-input.css');
    Tagging/class.tagging.plugin.php: $Sender->AddCSSFile('plugins/Tagging/design/tagadmin.css');
    Tagging/class.tagging.plugin.php: $Sender->AddCSSFile('plugins/Tagging/design/tag.css');
    VanillaStats/class.vanillastats.plugin.php: $Sender->AddCSSFile('plugins/VanillaStats/design/style.css');
    VanillaStats/class.vanillastats.plugin.php: $Sender->AddCSSFile('plugins/VanillaStats/design/picker.css');
    cleditor/default.php: $Sender->AddCssFile($this->GetResource('jquery.cleditor.css', FALSE, FALSE));
    embedvanilla/class.embedvanilla.plugin.php: $Sender->AddCssFile($this->GetResource('design/settings.css', FALSE, FALSE));
  • lucluc ✭✭
    2 (or more :) ) questions:
    - Is php case sensitive about functions names? (as AddCssFile is called with uppercase and lowercase "Css").
    - Why use GetResource? Especially for the flagging.css, and embedvanilla, as by default it will look into the design folder.

    To be able to theme those, we had to change (it was for tagging)
    -> $Sender->AddCssFile(tagadmin.css', 'plugins/Tagging');

    I can create a patch for all of those ones, but what should I do about the GetResource? Move the css to a design folder and change the call to as above?

    Furthermore, as the css are not unique, maybe it might be a good idea to be able have all of them in a separate folder, similar to what's possible for application?

    @Tim, @Mark, @Todd, @digibomb, @Lincoln (yep.. calling everybody)
  • TimTim Operations Vanilla Staff
    Hi @luc

    The extended syntax for AddCssFile that you're seeing there came along after I had written GetResource as a convenient shortcut for finding plugin CSS and views. AddCssFile() called in that manner has also had a couple of bugs until recently, so it hasn't been publicized. Nowdays though, it should be safe to use it.

    Make sense?

    Vanilla Forums COO [GitHub, Twitter,]

  • lucluc ✭✭
    edited March 2011
    . to be deleted.
  • lucluc ✭✭
    edited March 2011
    Extended, you mean with the 2 parameters? Such as the one I used so that lena could theme the tagadmin.css.
    I guess so (after reading again your comment), so it's safe for me to change everything using it, and create a pull request, right?
  • TimTim Operations Vanilla Staff
    If those things all worked (after testing) I'd be happy with such a pull.

    Vanilla Forums COO [GitHub, Twitter,]

  • lucluc ✭✭
    Well, I'll change them on my own server, and we'll see :).
    Some plugin I do use, some I don't. I'll enable them before and afterward to check it loads the same css file.
  • TimTim Operations Vanilla Staff
    Sounds good

    Vanilla Forums COO [GitHub, Twitter,]

Sign In or Register to comment.