Theme Creation GuideThis is a step by step guide for creating new themes for gpEasy CMS. Getting StartedThe easiest way to get started is by downloading a bare bones theme like the skeleton theme. Unzip the package to your computer and you'll find the essential files and structure of a gpEasy theme. FilesAfter you unzip the skeleton theme, you'll find four files and one subfolder:
This is the basic structure of a gpEasy theme where template.php contains the html and style.css contains the css. template.phpThe template.php file contains the html and php calls to organize your theme. There are a number of output functions available, but you'll need to include at least three: $page->GetContent(), gpOutput::GetHead(), gpOutput::GetAdminLink(). Here's an example of a very minimal template.php file. <!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" xml:lang="en" lang="en"> <head> <?php gpOutput::GetHead(); ?> </head> <body> <?php $page->GetContent(); ?> <?php gpOutput::GetAdminLink(); ?> </body> </html> style.cssA theme should have at least one css file named style.css. You'll notice in the template.php file, the style.css file is not referenced. This is handled automatically by gpEasy in the gpOutput::GetHead(); portion of the template. CSS ConsiderationsFor compatibility with gpEasy's admin interface, there are certain style considerations you should make. The top margin of the html and body should be zero. html,body{ margin-top:0; } Addon.iniThe Addon.ini file is not required for your theme to work unless you want to upload it to gpEasy.com. |
|