Pages:

Pages is the most essential part of the phpTank Content Management System. This is where you will display the information you want to show your visitors.

Pages can be located in several locations:

  • In Modules:
    • modules/_moduleName_/pages/_pageName_.php
  • In Template Modules:
    • templates/_templateName_/modules/_moduleName_/pages/_pageName_.php
  • In Templates:
    • templates/_templateName_/pages/_pageName_.php

The above is also the hierarchy - the loading priority for pages. Core Modules -> Template Modules -> Template. With template being top priority.

To understand the loading priority, you also need to understand that each page MUST have a fully unique filename. The reason for this is simple: customization! (This is covered in the template-before-core system located here)

If you have a file with an identical name located in any two places, phpTank will ONLY load the file in the location with the highest priority. Any file with an identical filename in lower priority locations will in this case be ignored. This may cause problems if the filename conflict is unintentional. BUT the power of this system outweighs the downsides, because you can customize a single page from a core module in a single template while loading the original file for every other template.

Making a new page:

There are a couple rules to follow:

  • Filename must be unique.
  • File extension must be .php.
  • File must be located in a valid pages folder (see locations above).

If you create the new file on your computer, upload it to one of the valid locations. If for example the templates/_templateName_/pages folder does not exist you can create it and upload the file to it and phpTank will take care of the rest.

Accessing the new page:

Now that the new page is uploaded it can be accessed instantly (if cache is set to on, it will be inaccessible until the cache file is refreshed) from any browser. to access your new page:

www.yourdomain.com/index.php?action=_pagename_ (Do not use the .php extension here, only the filename itself. or if it is an apache server and mod rewrite is on:

www.yourdomain.com/_pagename_.html

You may notice that the pagename extention in the url is .html, and not the .php we named the actual file. This is correct, and not a typo. phpTank will make the proper redirect.

Limitation:

Note: Due to the fact that .html redirects to the page with the identical name in the page loading system, there is one limitation: You cannot place an .html file directly in the root and access it directly as phpTank will try and match this file up against a page.

We know that some 3rd party systems use an html file in the root as a verification, so to bypass the phpTank redirect, rename the .htaccess file in the root to: bak.htaccess.