In order to effectively customize a style, you must first understand the parts that compose the design of that style. Styles, like houses, are built from smaller components that work together to create a frame. That frame, like the walls of the house, provides a structure for displaying the internal contents of a forum. These frames can be very complex creations so let us look at how the basic pieces are put together and stored, before we get into the actual customization of a style.
Styles are composed of three primary style elements, or smaller portions that work together to create the overall visual appearance of the style. These are the template, theme, and image set elements. Each style is self-contained and includes all the style elements needed to operate correctly.
The first and most important part of a style is the template element. The template element is a set of text files containing the entire markup that is used to generate the visual layout of a forum. The markup consists mainly of a markup language such as Hypertext Markup Language (HTML) and phpBB’s own special template features, but can also include client-side scripting languages such as JavaScript. Template files are used to arrange most of the information displayed by your forum. You can identify template files by looking at the name of a file; all template files have names ending with tpl
. Some examples are index_body.tpl, viewtopic_body.tpl
, and message_body.tpl
. Although this is rare, it is possible for multiple styles to use one set of template files with different themes and/or image sets.
The theme element of a forum style is a grouping of formatting rules used to define the visual decoration of a forum. The most common uses of the theme are specifying the font face, colors, background colors, and borders of page elements. Theme elements can be difficult to locate because they can be stored in three different locations. Most styles store theme data in one or more Cascading Style Sheet (CSS) files, such as subSilver.css
and formIE.css
. The name of the CSS files will vary with each forum style, but many times, there will be at least one CSS file named after the forum style. Some styles will place their CSS formatting rules in the overall_header.tpl
template file instead of a separate CSS file. Others may use a combination of the overall_header.tpl
technique and database storage of some values. The subSilver style uses the combination method, but also includes a CSS file that can be used after a manual change.
An image set element includes all the images that are part of a style. Some examples are the folder images, voting result bar graphics, and language-specific buttons such as "Reply" and "New Topic." There are also images that may be used mainly for decorative purposes, such as background or header images. Decorative images are sometimes considered part of the theme, instead of the image set.
In addition to the template files already discussed, the template element can also contain two special configuration files related to the theme and image set elements. The theme configuration file, theme_info.cfg
, is used for saving theme database data associated with a template. The saved data can then be imported into another forum’s database later. For the most part, you will only rarely need to edit this file. It is usually automatically generated or provided as needed. The second configuration file holds template configuration data. In most cases, that will merely be a list of graphic files in the image set of a style. These template configuration files have a name based on their matching template, such as subSilver.cfg
.
Details of all of the styles available on a forum are stored in the forum’s SQL database. The database only holds a list of installed styles, the name of an associated template element for each style, and some limited theme data. No image set data is stored in your database.
On the other hand, style elements are stored in the templates
directory of the forum file system. The templates
directory contains subdirectories that are named uniquely and after each individual set of template files. Each subdirectory of templates
will contain template, theme, image set, and configuration files for one or more styles. Until new styles are installed or created, the only subdirectory in templates
will be subSilver
.
In most cases, a templates
directory will contain two other subdirectories: admin
and images
. The admin
subdirectory will contain template files used to display the Administration Control Panel. The images
subdirectory will hold the image set used in the style, and may have language-named subdirectories, such as lang_english
or lang_dutch
, for images that display typed text in different languages. Some more advanced styles may include directories other than admin
and images
.
3.147.103.8