Top web site - CHAPTER 12 STYLING PHPBB 355 than 100
CHAPTER 12 STYLING PHPBB 355 than 100 separate template variables are available. Here, I ll cover the most commonly used template variables. For a comprehensive list of every template variable supplied with phpBB (excluding template variables that may be created by code modifications) with brief descriptions, see http://www.phpbb.com/styles/listvars.php. This list is kept up-to-date when changes warrant, so you can be confident that it s reliable information. Template variables generally come in the form {VAR}, where VAR is the name of the template variable as defined in the phpBB script file. If you are using a template variable defined inside a block (commonly seen on pages such as viewforum.php and viewtopic.php), the template variable will be formatted slightly differently: you ll see a line like {myblock.VAR}, where myblock is the name of the block in which the variable VARis defined. (You ll learn more about blocks in the next section.) Template variables are always denoted by the two curly braces surrounding the identifier. Therefore, you should use care when using curly braces in your layout. In fact, I recommend avoiding the usage of curly braces outside of template variables. If they are unavoidable, make sure you have one space separating the first curly brace from the word inside, and one space after the word in between. This way, phpBB will not attempt to execute the variable. If you use a template variable that isn t defined, phpBB will simply replace that variable with a blank space character. When using template variables, you can stick them anywhere in the template file in the
section of your HTML document, within a hyperlink, or anywhere else you wish a piece of text from phpBB to be output to the screen. For example, subSilver contains the following code snippet, which generates a title for the resulting HTML document from two template variables: The two template variables in this example are {SITENAME}, which will display the name of your site as you configured in the Administration panel when you first set up your board, and {PAGE_TITLE}, which is, predictably, the title of the page as set in the page s PHP code. This line displays in the title bar of the user s browser. So, for a site named MyForums on the Memberlist page, you ll see the following output in your HTML source after the previous code is parsed: Notice the clean replacement of text. Template variables are often small snippets of text, but they can also contain sizable chunks of HTML in some rare instances. I reiterate that you can use a template variable anywhere in a template file, as long as it will be defined for that file. Refer to Chapter 11 for details on creating template variables for use within your pages. Be warned: not every template variable exists in all pages of phpBB. There are two types of template variables: Global variables are defined in page_header.php and page_tail.php, and are available to every page in your script. Per-page variables are defined in each individual phpBB page such as index.php or viewforum.php. Template variables defined in files other than page_header.php and page_tail.php are not global to the entire script, and therefore take effect only for individual pages. Often, though,If you are in need for chaep and reliable webhost to host your website, our recommendation is http web server services.