Creating a blank phpBB3 page

Submitted by DoubleJ, Dec 2007.
Page: 2
Pages: [1] [2]

2. Creating the template file

Now that you have created your php file, you will need to add a template file to display the page.

We will now create the template file called 'your_page_body.tpl'.
First we will need to include our header, you can create a costum header, in this case we will include the overall_header.html file
Code:
  1. <!-- INCLUDE overall_header.html --> 
Now you can add your own html code from here. You can also insert additional switches, for example to display content which should be only available for logged in users:
Code:
  1. <!-- IF S_USER_LOGGED_IN --><p>Display logged in text<!-- ENDIF --> 
As you can see, you are not required to put template commands on a single line. You also don't have to use and make the switch such as [strong]<!-- BEGIN switch_name --><!-- END switch_name -->[/code]
Switches are now handled by if statements, loops however are still handled by the BEGIN commands, for more information on the templating system, have a look at this article which explains the basics of the phpBB3 templating system.

After you have included all of your html, you simply include your page footer, and you are done. The entire html page, should look like this:
  1. <!-- INCLUDE overall_header.html -->  
  2.  
  3.    <!-- IF S_USER_LOGGED_IN -->  
  4.    <p>Display logged in text</p>  
  5.    <!-- ENDIF -->  
  6.      
  7. <p>Include your page content here</p>  
  8. <!-- INCLUDE overall_footer.html --> 
Page: 2
Pages: [1] [2]

Share this tutorial

If you want to show this tutorial to someone else please use following code to link to this tutorial:
HTML Link:
Forum BBCode:
Content of this tutorial may not be published anywhere else without author's permission. Please link to this page instead.