Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Vanilla 0.9.3 - Better theming support?

edited March 2006 in Vanilla 1.0 Help
I've been really pleased with the Vanilla Framework and Mark has done a wonderful job! The only thing I still had some troubles with, was the theme support. Using html in php still messes up the beautyness of the application. I've found a way to still use the original theme-structure, but seperate the templates from the php code.

First, I've created the following directory structure in my themes directory:


Next, I copied all the theme php-files from the theme-directory to the subdirectory (scum in this case).

I use MiniTemplator to seperate code and templates. I've transformed the original class to a Vanilla one: Framework.Class.MiniTemplator.php. And put it in the library/Framework directory.

My theming now has neater code, and clean templates:

(Example of the discussion grid)




  • BTW! It also looks nicer when you check the HTML source :)

    Vanilla source

    Source with MiniTemplator class
  • edited March 2006
    I seem to recall Mark trying something like this, and not liking it for some reason. I'll attempt to locate that thread. EDIT: Apparently, this way was "simpler". You were in that thread too, pimping Savant.
  • MarkMark Vanilla Staff
    that sort of search/replace stuff is really great, no doubt. But it will absolutely slow the application down, and I can't afford to let that happen - esp considering that it is already built on php classes - which are slower than traditional spagetti php code.

    It may not be "simpler" for theme authors to program, but it is definitely "simpler" for php to parse.
  • MarkMark Vanilla Staff
    And regardless, progress has already been made on theming in the most recent version of svn - but it's just not ready yet. At the very least I've allowed you to specify piecemeal files for themeing instead of requiring every single template file.
  • Yes Mark, I agree, it will be "slower"... but don't we all have NASA and Pentagon computers these days? :) But seriously... I don't know how it would go on a 1.000.000 user/discussion site.... it works well for my setup and it's just a bit more manageble ^^
  • Well, since 1.0 will support multiple themes, I see no problem with the official theme staying as-is (for the performance hungry) and another theme taking a slower, yet cleaner, route.
This discussion has been closed.