Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
  1.  # 1
    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.
    •  
      CommentAuthorMark
    • CommentTimeSep 28th 2005 edited
     # 2
    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.
  2.  # 3
    *folds marks clothes.
    •  
      CommentAuthorKrak
    • CommentTimeSep 28th 2005 edited
     # 4
    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!
    • CommentAuthorwaylan
    • CommentTimeSep 29th 2005
     # 5
    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.
    •  
      CommentAuthorKrak
    • CommentTimeSep 29th 2005
     # 6
    Whoops, thought I fixed that last night...Thanks for saying so.
    •  
      CommentAuthorADM
    • CommentTimeSep 30th 2005
     # 7
    Yeah if you could post the files that would be great.
    •  
      CommentAuthorKrak
    • CommentTimeSep 30th 2005 edited
     # 8
    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.
    •  
      CommentAuthorADM
    • CommentTimeSep 30th 2005
     # 9
    Thanks for that :)
    •  
      CommentAuthornathan
    • CommentTimeSep 30th 2005
     # 10
    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.
    •  
      CommentAuthorKrak
    • CommentTimeSep 30th 2005 edited
     # 11
    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.
    •  
      CommentAuthornathan
    • CommentTimeSep 30th 2005
     # 12
    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.
    •  
      CommentAuthorKrak
    • CommentTimeSep 30th 2005
     # 13
    It shouldnt be, and an extension to do all of that would def. rock.
    •  
      CommentAuthorBen
    • CommentTimeOct 1st 2005
     # 14
    Something like Wordpress' page feature I think.
    •  
      CommentAuthorGhazi
    • CommentTimeOct 21st 2005
     # 15
    Krak, what happened to your example files? The links are broken... :(
    •  
      CommentAuthorKrak
    • CommentTimeOct 21st 2005
     # 16
    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.
    • CommentAuthorSirNot
    • CommentTimeOct 22nd 2005 edited
     # 17
    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.
  3.  # 18
    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();
    • CommentAuthorSirNot
    • CommentTimeOct 22nd 2005 edited
     # 19
    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?
    •  
      CommentAuthorKrak
    • CommentTimeOct 22nd 2005 edited
     # 20
    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.

    @Edit2...lol, isnt that always how it works?
    • CommentAuthorSirNot
    • CommentTimeOct 22nd 2005 edited
     # 21
    >@Edit2...lol, 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.
  4.  # 22
    Yeah, cheers for that fix. Be sure to add that extension to the wiki if it isnt already, looks like a pretty nice job front-end to me though i havent checked the back side of it yet.
    The permissions thing does seem worth avoiding if possible though. It'd need a warning about that if you do put it on the wiki.
    •  
      CommentAuthorBen
    • CommentTimeOct 23rd 2005 edited
     # 23
    I get the following errors when I try to use it.

    Warning: fopen(extensions/CustomPages.txt): failed to open stream: Permission denied in /vanilla/extensions/tabmanager.php on line 62

    Warning: Variable passed to each() is not an array or object in /vanilla/extensions/tabmanager.php on line 46

    Warning: reset(): Passed variable is not an array or object in /vanilla/extensions/tabmanager.php on line 55
    • CommentAuthorSirNot
    • CommentTimeOct 23rd 2005 edited
     # 24
    That's because the directory in which CustomPages.txt will be located has to have read/write permissions on it. Correction, PageMng.php (or whatever you named it as) needs to be able to read and write to the directory in which CustomPages.txt resides.

    If you guys wanted I could make it use a MySQL table. Just seemed a bit overkill for this one extension, especially since it probably won't be very widely used and the information it needs to store is very minimal.

    EDIT: By the way, if you downloaded that extension more than 5 minutes ago or so, I'd redownload it. There was a bug in it which didn't allow other extensions included after it to run when you clicked a custom page.
    •  
      CommentAuthorBen
    • CommentTimeOct 23rd 2005
     # 25
    Ahh, not the root vanilla directory, my mistake...

    Is there any way to include PHP on the pages? Or can only HTML be used?
    • CommentAuthorSirNot
    • CommentTimeOct 23rd 2005
     # 26
    You should now be able to embed PHP within the HTML file, the beginning tag just has to be <?php, not the shortened version. This might be buggy, so bear with me if it dosn't work fully as planned.
    •  
      CommentAuthorKrak
    • CommentTimeOct 23rd 2005
     # 27
    With the new rev of vanilla I believe there will be a extensions table. Usefull for things like this.
  5.  # 28
    Yeah krak - but worth avoiding if it is set data and fairly minimal. Perhaps the best thing to do would be to move the writeable directory below web level as i think mark is planning for some other folders for the next rev after security discussions.
    •  
      CommentAuthorGhazi
    • CommentTimeOct 23rd 2005 edited
     # 29
    I'd like to be able to refer to the user name or his favorite color or whatever variable (taken from the user's profile) within the text of a page created using SirNot's extension. Is that possible?
    Example: echo "Hello ".$username;
    Where and how can I define $username to be the session's user real name?
    • CommentAuthorSirNot
    • CommentTimeOct 24th 2005 edited
     # 30
    You'd want this:

    &lt;?php
    global $Context;

    echo('Hello '.(!$Context->Session->User->RoleID ?
    $Context->GetDefinition('Guest') :
    $Context->Session->User->Name));

    ?&gt;

    Treat any code you enter in that like a function; any variables you want to use that are in the global scope you have to include like that, as it's going to be parsed within the CustomPage->Render() function.
    •  
      CommentAuthorGhazi
    • CommentTimeOct 24th 2005
     # 31
    Thanks a bunch SirNot! :)
    This brings Vanilla to a whole new level...
    •  
      CommentAuthorKrak
    • CommentTimeOct 26th 2005
     # 32
    Something odd with 1.4 - 1.1 works just fine, but I cant get 1.4 to work.

    The panel link is there, the links work, I can edit, change, etc the pages, but the tabs dont show up. I tried all disabling extensions and nothing worked. Something off with the tabs.
    • CommentAuthorSirNot
    • CommentTimeOct 26th 2005 edited
     # 33
    That's because your CustomPages.txt file is a different format. Versions 1.3+ use a different array structure, as they allow you to change to roles which can see it. Try clicking the Resync Tabs link then editing all your custom tabs (making sure that all the roles you want it to display to are checked), as that should add that last array element which says which user roles can see which tabs.

    I'm afraid you'll also have to delete any system tabs which you edited, as there's a bug in the earlier versions of the extension which dosn't edit those properly.
Add your comments
    Username Password
  • Format comments as