Skip to content

Layout customization

Frug edited this page Oct 11, 2012 · 1 revision

Layout customization

Cascading Style Sheets

The layout of AJAX Chat is fully customizable by using CSS (Cascading Style Sheets).
AJAX Chat comes with a predefined set of styles. To add your own style, do the following:

  1. Add a new CSS file (e.g. mystyle.css) by copying one of the existing styles from the CSS directory.
  2. Edit your file (css/mystyle.css) and adjust the CSS settings to your liking.
  3. Add the name of your style without file extension to the available styles in lib/config.php:
	// Available styles:
	$config['styleAvailable'] = array('mystyle','beige','black','grey');
	// Default style:
	$config['styleDefault'] = 'mystyle';

Template files

To further customize the layout you can adjust the template files in lib/template/.

Make sure you are creating valid XHTML, else you will produce errors in modern browsers.
This is due to the page content-type served as "application/xhtml+xml".
Using this content-type improves performance when manipulating the Document Object Model (DOM).

If for some reason you cannot create valid XHTML you can force a HTML content-type.
Just edit lib/config.php and set the following option:

$config['contentType'] = 'text/html';