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.

Template System

edited August 2005 in Vanilla 1.0 Help
Although i love the FileBrowser, i was wondering if your thinking of implementing some form of Template API so that it would be simpler to re-arrange the layout of things. As currently i need to hack/mod the functions myself to move things like the folder lists above the preview image and such. Just an idea but i think it would be a great help!


  • concur, albeit moreso with such functionality in vanilla.
  • it's all css, you can change the layout pretty easily... in version 2 i wrote a style sheet that moved the directory listing to the right or left of the page
  • Yeah if i wanted to just style the basic layout i could very easy do it with CSS, but im needing to merge it into WordPress for my site, which requires me to delve into the functions. Also it would be nice to be able to simple rearrange elements, like moving the now and next to a side bar or moving the current path to somewhere else than the top. Sure its possible but if there was a nice simple template api we could just use functions like directoryPath(NoRoot,ListSubs) and such to allow for much more simpler intergration of this into CMS and Blogs
  • MarkMark Vanilla Staff
    There are two problems with templating the filebrowser: 1. It was meant to have as few files as possible. The original filebrowser was a single file that you'd just drop into a directory, and I've even been considering getting rid of the config and filetypes.xml file for the next rev. 2. In order to make it run fast, I've done some really wacky string building as the page is parsed. I did this so that it could perform multiple tasks at the same time during big looping calls, rather than having to loop things three or four times, it only has to do it once. Now, what you're asking is not uncommon, and I think that it is worthwhile to change the filebrowser to allow this, but it won't be happening any time soon. I'm not planning on revising the filebrowser for quite some time - too many other things on my plate at the moment. You are, of course, welcome to hack it out yourself and post the results on here for others asking for the same thing.
  • You could always just build the strings then use smarty ( for templating.
  • MarkMark Vanilla Staff
    wow. smarty is cool - and it's exactly what I was planning for templates in the next rev of vanilla.
  • edited August 2005
    No reason to re-invent the wheel!

    If you haven't already seen it, the PEAR library is also way cool (
  • There's no reason to use Smarty. Instead, a simple, elegant, and powerful alternative exists, with a much smaller footprint: Savant ( Savant uses PHP as its template markup language; among other things, it allows you to build object-oriented plugins to provide your own custgom behaviors. Finally, If you decide that you really do need to "compile" your templates, you can write a custom compiler that does exactly (and only!) what you want. Of course, I'm the author, so I'm biased in favor of it. ;-)
  • i am happy that templates will be included. makes me think of sticking around.
This discussion has been closed.