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.

How to build entire new pages...

edited October 2005 in Vanilla 1.0 Help
Can someone (mark? lech?) give us all a quick idea how to build an entire new page? Adding tabs and stuff seems pretty easy but the desire to build entire pages seems to be growing. What is the process for doing so? I figure if we can try and keep it all in here it'd make an easier reference - perhaps adding it to the wiki would be a good idea; unless its already there and i've missed it in which case i'd be greatful for a link.


  • MarkMark Vanilla Staff
    edited September 2005
    You pretty much have to do exactly what all of the other pages do. Take a look at the categories.php page, for a simple example.

    If you want a better understanding of what happens as the page is processed, check out the wiki

    Sorry to be so brief. I'm packing for a trip tmw morning.
  • *folds marks clothes.
  • KrakKrak New
    edited September 2005
    I have made an extra page, pretty much a hack though. It wasnt done nice and clean, like with a interface or anything. But I have a tab up top and a new page that works (as far as I can tell).

    I used the "Users" tab extension, changed it to reflect my new page. So if I wanted to drop the page from the list all I have to do is disable that particular extension, and whalla, it wont show up in the nav links. But the page is still there.

    I copied the categories.php in the root dir, and had to do the same in the control dir. Changed a few lines in the root page to what I wanted my new page to be (styles), and then in the control page is where I added what actually shows up on the page.

    Head over to my site (seems like I am always shamelessly pluggin my site), and you'll see it. I can post the files I modified in a txt format if you want to check it out. Just say so.

    All in all:
    • copy/rename/edit root/categories.php
    • copy/rename/edit controls/categories.php
    • copy/rename/edit the userstab extension
    Im sure there is a better/cleaner way, this is just how I figured out how to do it. So if anyone knows of a better/cleaner approach, please share!
  • Cool, but ahh, did you realize that you have the same text for both of the styles listed. In other words, the description of Rage is identical to the description of Clockwork. I realize that is probably not really realavant to getting the page working, but I thought I'd mention it.
  • Whoops, thought I fixed that last night...Thanks for saying so.
  • Yeah if you could post the files that would be great.
  • KrakKrak New
    edited September 2005
    Examples of the files:

    1. NewPageTabMenu.php (extension)
    2. NewPage.php (root dir)
    3. NewPage.php (controls dir)

    Replace any text that says "NewPage". Some (most, if not all) of the items are case sensitive.
  • Thanks for that :)
  • how about a new page making extension. That creates these files, or creates OTHER extensions based on variables passed to it. That wouln't be too hard to create the files.
  • KrakKrak New
    edited September 2005
    Thats a great idea. But before the effort was made to make it, we need to know if this is the proper way to make pages. And... it might be best to wait till next the version comes out.
  • I would of course wait until the nex rev comes out. I will look at the catagories page or something similar to see how they are created for myself. I don't think it is to hard.
  • It shouldnt be, and an extension to do all of that would def. rock.
  • Something like Wordpress' page feature I think.
  • Krak, what happened to your example files? The links are broken... :(
  • Whoops, must have deleted them the other day on accident. Had to make some new ones, hope they are the same. Links should be working now. Any questions, just ask. Eventually I will make this a better extension.
  • NickENickE New
    edited October 2005
    Hope Krak dosn't mind, but I sort of had nothing to do so I created an entire extension to do this. It's here if you want to try it out. Just make sure the root vanilla directory's writable and this'll enable you to create/edit/delete tabs as well as change their order.
  • Sounds impressive - though after an install i get: Technical information (for support personel): Error Message: The "DiscussionManager" class referenced by "DiscussionManager" does not appear to exist. Affected Elements: ObjectFactory.NewObject();
  • NickENickE New
    edited October 2005
    Shit, sorry about that. Try it now, forgot to set a default value. By the way, this assumes that index.php is the default. In other words, it'll come up with errors if index.php is a renamed categories.php. EDIT: That should be fixed now. EDIT2: Fixed a few more bugs. Why do I always find the majority of the bugs after releasing to the public?
  • KrakKrak New
    edited October 2005
    Rock on. Dont mind at all. Saves me the trouble, heh. I've been busy with a few other things so I havent had much time to spend on it. Works pretty good, nice job. Some wierd stuff in those txt files. The only thing... I dont think having to change the root folders permissions is nec. a great idea. I'd suggest having a folder in the extensions folder like "extensions/pages/" and placing all the page txt's in there. It keeps it all nice and tidy too., isnt that always how it works?
  • NickENickE New
    edited October 2005
    >, isnt that always how it works? No, not really. If you had renamed categories.php as index.php before that bug was fixed, it'd be trying to access numerous classes that hadn't been defined yet, hence one of the reasons for minisweeper's errors when he tried to access the categories page. As for the txt file, it's merely a serialize()d version of the array. Looks pretty weird at first glance. But yeah, you're probably right. I'll make the filename a bit more accessible so you can easily change it to wherever you want. EDIT: Done.
This discussion has been closed.