Additional Pages


I need some guidance how to add extra pages like FAQ.

Comments

  • edited January 11
    This tutorial will make you able to add any page not only "FAQ"

    let's make an example for "FAQ"

    STEP 1

    The first thing you need to do is opening "system/controllers/Admin.control.php"

    and search for this pages function "pages()" you may find it in line 893

    we gonna add
    $faq      = Request::post("update_faq");
    and
    "faq" => htmlentities($faq)
    to the code

    like this

    public function pages()
    {
    if(Auth::check("admins"))
    {
    $faq = Request::post("update_faq");
    $privacy = Request::post("update_privacy");
    $about_us = Request::post("update_about_us");
    $tos = Request::post("update_tos");
    if(isset($privacy) or isset($about_us) or isset($tos))
    {
    $new_pages = array(
    "privacy" => htmlentities($privacy),
    "about-us" => htmlentities($about_us),
    "tos" => htmlentities($tos),
    "faq" => htmlentities($faq)
    );
    ...

    STEP 2

    Now we've to open the admin template folder "themes/admin/default"

    and open "pages.php" file

    we gonna add this code

    <div class="form-group">
    <label class="control-label" for="inputDefault">
    FAQ page - <a target="_blank" href="<?php _router("page", array("name" => "faq")); ?>">show</a>
    </label>
    <textarea style="height: 500px;" placeholder="FAQ page (TEXT - HTML )" class="form-control" name="update_faq" id="inputDefault" type="text">
    <?php echo htmlentities(s("pages/faq")); ?>
    </textarea>
    </div>
    as you can see in this picture
    image

    STEP 3

    Now Go to admina panel >> pages for editing
    & you'll be able to see this page on http://YOURWEBSITE/page/faq

    Hope that's help

    Regards, Hassan A
  • Thank you very much.
  • Hi
    mr. Hasan i tried to add the page but i failed. Step 2 is OK but on step 1 i got 500 internal error. I am not a coder but i saw that in line:
    if(isset($privacy) or isset($about_us) or isset($tos))

    missing or isset($faq)

    but even i add no succeeded. I thing that may be something else need.

    Can i ask to recheck and advice?

    Thank you in advance .
  • Hi

    the code is right and tested,

    did you did this step "Go to admina panel >> pages for editing"

    you must edit this page before testing..

  • Hi

    After step 1 i can not access to admin panel anymore. I am getting 500 internal server error when i hit the admin panel.
  • tenso500 said:

    Hi

    After step 1 i can not access to admin panel anymore. I am getting 500 internal server error when i hit the admin panel.

    This mean you did something wroung in the code, do not copy & past
    Try to type , or just mail me with your FTP access at devknown@gmail.com and i'll findout what's wroung
Sign In or Register to comment.