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.
Options

New Vanilla Template System

outbreakoutbreak New
edited December 2005 in Vanilla 1.0 Help
mark, i know you're working on the latest version with a revised template system. is there anyway you could quickly describe the changes you made to make the forum easier to style? i'm very curious about that o8 screenshot you keep posting and just how much easier it actually will be to stylize vanilla.
«1

Comments

  • Options
    MarkMark Vanilla Staff
    Here's how the folder structure is set up currently:

    image

    So, there is a base folder that holds all themes. You can create a new theme by just copying the default vanilla theme and then altering all of the files within. As you can see, right now in the templates folder there are only five template files that I've created. I've still got to go make a few other ones - eventually it will hold all template files for all pages.

    Those template files contain all xhtml in vanilla, so you can change it completely. I haven't dumbed it down at all - there is php code in those template files, too. So if you were a smartypants, you could pretty much do whatever you wanted in there.

    The next thing to wrap your head around is how themes are applied. A forum will only ever have a single theme applied to it. So, on this forum you couldn't have one person seeing that o8-style theme and another person looking at this current default vanilla theme. There are various reasons for that, the biggest one being that if a theme intrinsically changes the way the forum functions, then one person might be able to do something in theme A that theme B never intended that person to do.

    But there is still custom styling on each theme - which is why each theme (as you can see in the image) has a "styles" folder. The idea there is that once you've defined the xhtml how you want it, you can still apply multiple styles to it and allow your users to switch between those. So in the future we'll have new themes coming out and available to vanilla administrators - and then we'll have new styles coming out for particular themes, and those styles are available directly to the forum users.

    Does that help?
  • Options
    Wait, so in the next rev people wont be able to run different themes on the same forum? What are the chances of the forum admin being able to choose between running a theme system OR the existing style system? Pretty much zero i assume? /me watches marks head explode.
  • Options
    NickENickE New
    edited October 2005
    I think he's saying that in the next revision the entire theming system will sort of step back one pace. At the current, the html is embedded within the PHP, and you can style it differently with CSS but can't actually change the html without a whole lot of difficulty. With the new system, each theme will contain the html, and within each theme users can run different styles. As the themes, containing the html, will have a large effect upon how users interact with the forum, there can only be one theme running at a time, but within that theme different users can style it with CSS how they like. Not sure if that's entirely accurate, just my impression.
  • Options
    Um, hold on, somehow i managed to completely miss that entire last paragraph. *bows and exits
  • Options
    Damn, that's damn impressive setup/idea. I can't wait to get started.
  • Options
    +10 points for powerful theming engine

    +100 points for excellent css style control within the theming engine

    i can't wait to see this.
  • Options
    MarkMark Vanilla Staff
    Wait, so in the next rev people wont be able to run different themes on the same forum?

    That is correct, but they *can* apply different styles to the current theme.

    What are the chances of the forum admin being able to choose between running a theme system OR the existing style system? Pretty much zero i assume?

    Well, it's open source, so you can do whatever you want. Originally that was what I wanted to do, but as I mucked about in the xhtml on my first test theme I realized that looking at the site in two different themes posed a myriad of potential problems, so I pulled back on the reigns.

    SirNot got it bang on.
  • Options
    Right when I start visiting this forum less and less, Mark releases more captivating sneak peaks. I have my attention.
  • Options
    "I realized that looking at the site in two different themes posed a myriad of potential problems" - well to my thoughts, you wouldnt have to use 2 different themes, what i was suggesting was that people could choose between how the style system runs now, and how it's going to run soon. But that's because i misread that the users would infact stil have control over the stylesheet they were using, in which case my theory is pointless.
  • Options
    lechlech Chicagoland
    Mini, it's gonna be great, nothing to worry about :)
  • Options
    i know, i'm a little worried that i doubted mark for nearly a whole second there. Forgive me father, i've been working overclock recently.
  • Options
    edited October 2005
    The php files in the root folder (current version) seem basically to be bare wrappers around controls that do the actual page rendering; is this true of the template files in the new version?
  • Options
    MarkMark Vanilla Staff
    It's an extension of the page controls. Basically, the page controls will now just include the rendering templates where required.
  • Options
    Mini, it's gonna be great, nothing to worry about :)

    Tell me about it. I can't wait.
  • Options
    This could prove to be an annoyance in some cases. If you made a style that relied on a certain theme, your audience can only use it if they scrap what theme and styles they already have and use yours instead.
  • Options
    yeah ben - thats partly what i was considering when i was startled at first that people wouldnt be able to swop styles as they can at present. I suppose it depends how many people go to the extra effort of making an entire theme - i presume that there will be considerably more styles than themes.
  • Options
    so if the admin switch the theme on a forum will it automatically switch the users' chosen styles as well?
  • Options
    i assume it must do.
  • Options
    MarkMark Vanilla Staff
    I haven't yet written a theme switching control. But when I do it will have two selectors on it - the first will contain the theme selection, and the second will contain a "default style" selection. So if you create a new theme and create three styles for it, you can select your theme in the first dropdown, and then choose which style you want to default users to in the second selector. However, this will be an extension since I expect that for the most part an administrator will create a theme when starting his/her forum and then only very rarely re-template their forum.
  • Options
    So you mean the entire thing wont be an extension? Or will that just be an extension extension?
This discussion has been closed.