~~NOTOC~~ ====== Theme Creation ====== There is a [[themes:tutorial|Step-by-Step Tutorial]] for converting a static html page into a php template for a GetSimple theme. If you are building a site from scratch, converting an existing site to GetSimple or you have a web page you want to use as a template you need to create a GetSimple //Theme// which will define the html and css of your web pages. Just as a single html file can define a web page there is only one truly required theme file, and that's ''template.php''. ''template.php'' defines the html of the default page layout for your site, but you can make other page templates and set particular pages to use an alternative template by choosing it within the **Page Options -> Template** setting:{{ :themes:page-options.png |}} Content is inserted into your page template by using [[themes:template_tags|template tags]] similar to WordPress. You then place that file within it's own uniquely named folder and [[themes:installation|install it]] on your server. All template pages are given the .PHP extension. ===== Anatomy of a Theme ===== The default page template named ''template.php'' goes inside a folder named specifically for your theme, and placed within the theme folder of your GetSimple installation such as: ''/path/to/getsimple/theme/my_theme/template.php'' You can rename a theme by renaming the folder that contains it. If you just want to add another template as part of an existing theme you may place it in that theme's directory with any name other than ''functions.php'' and ''*.inc.php'' and it will show in the selection field of the above form. Other files found in a theme folder are: * Normally an external stylesheet referenced in the html of the page template file. * Alternative, optional templates for other pages such as ''homepage.php'' or ''contact.php''. They will be available for selection in **Page Options**. * A file named ''editor.css'' in the theme folder will enable the CKeditor to display page content more accurately. * Any images used in the theme, along with favicons and backgrounds * A screenshot image of your theme saved in an //images// folder as ''/path/to/getsimple/theme/your-theme/images/screenshot.png'' will be displayed on the Theme Selection Page in the Admin Pages.((Be sure to name it that exact name or else our system will not pick it up. Lowercase AND in the folder /images/ AND named screenshot.png)) * A file ''[[theme:advanced#theme_functions_file|functions.php]]'' contains any custom functions that are used within your theme. * Sometimes template files are split into parts and saved as [[theme:advanced#optimal_theme_files_layout|partial template files]] with names like ''header.inc.php'' * Sometimes javascript and other files are included in the theme ===== Theme Development Tips ===== * Start any PHP file within your theme with ''''. This will stop any unwanted direct access to that particular file. * Most themes id the body of the html by writing the opening body tag '''' It makes it easy to restyle a single page. * Many plugins require '''' between the '''' tags and '''' somewhere before the closing '''' tag. * urls in php template files need to be written as absolute links not relative, in the form http://www... or with the path called by or so that they will always be correct even if the site is moved. ======Links====== Back to the GetSimple Wiki [[:start|Contents Page]] ==Pages in this Section== ===Themes=== *[[themes:installation|Ready-Made Themes]] *[[themes:creation|Theme Creation]] *[[themes:template_tags|Complete Template Tags Reference]] *[[theme:template_code_snippets|Template Code Snippets]] *[[themes:tips|Theme Development Tips]]