HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to add extra pages?

Hello,


I would like to add a privacy policy and terms and conditions in the forum.

As the forum is on the main domain name, I only have this script installed.

What is the best way to create new static pages please?


Thanks.

Comments

  • AoleeAolee Hobbyist & Coder ✭✭

    There are new and better ways now i think, but I'm still using the good old CustomPages Add-on.

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    I’d recommend to go for static HTML pages for that. With some rendered forum HTML and a link to Vanilla’s CSS the look and feel could be shared and it can’t really break on updates like plugins.

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • Thanks for the reply but where is the doc for custom static page please?

    I cannot see it anywhere.

    ie:

    In the public_html, which files should be edited to get a static page? Route file, which header and footer? I am lost, the doc needs a good tutorial on this.


    Thanks

  • R_JR_J Ex-Fanboy Munich Admin

    How to create a html page on your own is written in countless tutorials all over the internet. How to write a route in Vanilla is documented.

    Based on that question:

    In the public_html, which files should be edited to get a static page?

    I would recommend you better use a plugin for that. I highly recommend Basic Pages for that. But please read the installation instructions carefully.

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    Follow R_J’s suggestion.

    If you’d go for static HTML you would simply create a subfolder in your Vanilla Root installation called ~/static/ for example and put terms and conditions HTML documents inside. Link them from the footer of your theme. That’s all. Bit of a more effort now but less hassle later. ;)

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • bennyboybennyboy New
    edited November 2019

    I find it weird that there isn't a clear tutorial that simply shows you:

    1)Create a folder called /static/

    2)Add a file , ie: terms.html(boiler plate would be superb)

    3)Copy/paste this header and footer code in the terms.html file(from where?, which file is pulling the main header and footer?)

    4)Write your content in between the tags xxx

    5)Create the route in file XXX.php


    This on it's own would eliminate the need for plugins for most users.

  • R_JR_J Ex-Fanboy Munich Admin

    If you are looking for static html, why should there be a template? Simply inspect any of your forums pages and take what you need....

    You don't have to add the route to some configuration file, you can (should!) write the routing parameters in the dashboard.

    If you are interested in how things work behind the scenes (I just say so because you said you have some experience with laravel), you would have to create a controller and a view - no need for a model here. That can be done by a plugin or a theme.

    The terms of service are already included, by the way. But not as a nice page, but as a popup that you can open during registration. It can also be accessed directly, but it looks freaking ugly: https://open.vanillaforums.com/home/termsofservice

    The text can be customized (it's Markdown): https://open.vanillaforums.com/search?Search=termsofservice

  • About:

    You don't have to add the route to some configuration file, you can (should!) write the routing parameters in the dashboard.

    lol that's a good one, as I am used to Laravel I kept trying to find a route file , when in fact it is in the dashboard........duh....

    Ok it looks like the routing is registered in Mysql, ok got it and then called each time from the database that a page loads.

    "The terms of service are already included", Yes you are right, it is ugly :-) I will have to change that.


    About:

    If you are interested in how things work behind the scenes (I just say so because you said you have some experience with laravel), you would have to create a controller and a view - no need for a model here. That can be done by a plugin or a theme.


    Thanks a lot, I will check this in depth.

  • Could you please tell me what should be the target for the DefaultForumRoot as I changed it and forgot to write down the old target.


    Thank you.

  • R_JR_J Ex-Fanboy Munich Admin

    Normally it is "discussions" and "internal"

  • bennyboybennyboy New
    edited November 2019

    Thanks.


    It is very strange or perhaps I have not understood how it works but I created a folder called:

    "pages" in the public_html folder(the root of the forum).

    I added a page with a bit of php which echoes "Hello";


    I then create the root:

    ROOT:test.php

    TARGET: /pages/index.php

    TYPE: internal


    I still get:

    Page Not Found

    The page you were looking for could not be found.


    I tried to follow the container example above it in the dashboard.

  • bennyboybennyboy New
    edited November 2019

    Sorry I meant:

    ROOT:test.php

    TARGET: /pages/test

    TYPE: internal

  • R_JR_J Ex-Fanboy Munich Admin

    It might become more clearer why it failed when you read about the front controller

    If you want to learn how to write a custom page on your own, you might want to start with this example

  • It is ok, I decided to use this:


    It still works in the latest version of Vanilla.

  • Dang, just seen your reply now....if I knew....I already installed the other plugin and add my terms and privacy policy.

    Thanks again

  • edited November 2019

    FWIW @bennyboy, creating a physical folder within vanilla root and then internally pointing to it can prove rather futile without first seeing what the apache/nginx rules are.

    Vanilla's Rewrite Rules hungrily and securely reroutes everything to itself, it is a CMS after all, secretary in charge!

    example.com/forum/phyiscalFolder/

    The above address fails because Vanilla thinks there is some page of its own that it is supposed to find. And Vanilla does not deal in physical files for content... thank goodness this is not a flat file forum ... :)

    For apache, find in the root, .htaccess (the last two lines are responsible for this mischief)

        ####
        # Prevent access to any php script by redirecting the request to /index.php
        # You can add an exception by adding another RewriteCond after this one.
        # Example: RewriteCond %{REQUEST_URI} !^/yourscriptname.php$
        # You can comment out this section if it causes you problems.
        # This is just a nice to have for security purposes.
        ####
        # RewriteCond %{REQUEST_URI} !/index.php$
        # RewriteRule (.+\.php) [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]
    
    
        ####
        # Redirect any non existing file/directory to /index.php
        ####
        RewriteCond %{REQUEST_FILENAME} !-f 
        RewriteRule (.*) index.php [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]
    


  • If I had only two cents and you were to beg me of them, I'd give you thusly:

    Oneth Cent: For custom pages, I would never use any dedicated plugins or applications or super duper any custom code.

    Second Cent: I would use my normal forum native pages (less hassle in future)

    Third Cent: I would re-frame my questions to: how can I style/template certain forum posts/pages differently? How can I have these native forum posts/pages use a cleannnnner url etc

    Fourth Cent: I'd set an interest on my initial two cents and call it a day.

  • I tell you it becoming so difficult nowadays....

    My last 9 days....

    Day 1, customer asking how to fix a wordpress plugin, i have never hardcoded wordpress...spent ages trying to figure out how this works.

    day 2, another customer having a problem with Vuex, fixed it.

    Day 3, Customer having a problem with an htaccess redirection, spent ages getting this working.

    Day 4, customer having problem with Laravel

    Day 5, customer having problem with an apache server

    Day 6, customer having problem with his SSLs not being generated properly and cpanel errors.

    Day 7, customer wanting modifications to an APK with Cordova

    Day 8, customer needing an update on a phonegap app

    Day 9, trying to figure how to setup this forum for a customer.


    Day 10.....no idea if is is only me, but I am just getting tired to try to figure out new technologies here and there on a daily basis, I am honestly getting tired of it. I started to read the doc of the Vanilla forum and I was like....oh no...I need to understand a new thing again.

    You learn Angular, React comes, customer want react, Vue comes, customer wants vue....and so on....

    I am not enjoying web design anymore, I keep jumping from one thing to the next without anymore fun but just learn how someone else thought about his own framework or library.


    In between you have to learn workbench, photoshop, phpstorm, android studio to publish your dev apps,docket, laragon, after effect, sonar platinum......


    No idea if you agree with me, or perhaps you guys are working on the same stuff on a daily basis, if you are, you are lucky if you have managed to find your own customers in a single niche, I just can't....

  • I totally hear you and sympathize. One day there would no more letter combination in the English Language to satisfy the odd silly naming convention of the numerous JS frameworks. It is quite ridiculous and painful.

    With each new one, there is a growing community behind it saying how this new one is the future and how the other one is dying and how if this CMS or that project does not upgrade, they'd fall out of the planet.

    I stuck with jQuery heavily because it made me learn a lot and interested in raw JavaScript itself. I support just a few CMSs, some I will not even touch, for my sanity sake.

    Then again, your tale is one of the curses of FULL stack web developer ... wait until sys admin duty creeps in.

    This is why I am supporting Vanilla Forums. It does not require me to fire up a whole new dedicated server - I simply don't have that time/interest any more.

    Oh, and one needs to perfect one's workflow and be thoroughly organised or else, madness is around the corner. Use platforms that run well out of the box etc etc.

    And yes, I just spoke to someone few weeks ago who mentioned about possibly quitting this stuff - it is not a bad idea to start building a non wholly-internet-dependent lifestyle.


    Cheers.

Sign In or Register to comment.