After building many custom templates for use with Soholaunch and becoming fed up with the limitations of template pound variables, I’ve decided to standardize some simple functions. The result is my Soholaunch Template Class, something I will continue to add to as needed.
Suggested Use
With this class, I’ve restructured how I use my template files. A very simple template folder would contain the following:
- index.html
- custom.css
- images (directory with my template images)
Now I have made a slight change to my structure so I can easily use PHP throughout my main template file.
- SohoTemplate.class.php
- index.html
- index.php
- custom.css
- images (directory with my template images)
My index.html file now contains only the following:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
#output-SohoTemplate.class.php#
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>#PAGETITLE#</title>
<link href="custom.css" rel="stylesheet" type="text/css" />
</head>
<body>
#output-index.php#
</body>
</html>
Functions
I will continue to add to this list as the class becomes more diverse.
