Create a Custom Theme

From PhpCOIN Documentation

Jump to: navigation, search

Some people wish to change the look of phpCOIN and are not satisfied with the four built-in themes, or the free themes from 3rd parties available on the phpCOIN downloads page. If you would like to create your own v1.x theme, an easy way to do this is to tinker with an existing theme.

The best way to tinker with a theme is to create a copy of it, and work on the copy. That way, future updates to phpCOIN or the theme will not overwrite your changes. To create the copy, simply make a new folder within /coin_themes and call it whatever you want. Take all the files from an existing theme that you wish to change, and copy them into the new folder. Now tweak away.

1: Edit the styles.css (and styles_print.css for printed pages) to use your colors/fonts/etc.

2: Edit the functions within coin_themes/xxxx/core.php that build each portion of the page.
   What each function does is pretty obvious from the name: do_page_header, do_menu_user,
   do_page_footer, etc.

3: Remove/replace/add existing theme graphics with your chosen graphics.

4: Ensure that /coin_themes/xxxxx/config.php has the correct settings for your new images.

5: In order to tell phpCOIN to use the new theme, you need to change:
     Admin -> Parameters -> common -> package -> Package Theme (database setting)
     and specify the installed theme that you want to use.

Generally when you create your own version of an existing theme's look & feel you only change the logo, buttons, fonts & colours. This technically is not a new theme but a variation of an existing one. In fairness to the original designer you should credit their work as the inspiration for yours - a link to their website would be appropriate and appreciated.

Enabling WYSIWYG In 3rd Party Themes

Please be aware that a 3rd party theme may or may not have support for the WYSIWYG editors that phpCOIN automatically supports, so you may have to edit the theme to include the necessary code. In phpCOIN v1.4 and higher, this is easy. In the core.php file for the theme, find the functions that start and end the building of the html output, usually do_page_open() and do_page_closeout()

Add the following lines before the </head> tag is output by the theme:

# Add WYSIWYG (if found) to output

and add the following lines before the </body> tag is output by the theme:

# Add WYSIWYG (if found) to output

phpCOIN itself will look after determining whether the htmlarea or TinyMCE wysiwyg editor is installed, and whether or not the code should be called on this page, and building the initialization calls.

If the theme has any pre-existing code to load the wysiwyg editors, remove it and replace it with the lines shown above.

Personal tools

Inscrita el Registro Mercantil de Mallorca Tomo 2140, Hoja No. PM-51034, Folio 135
This website owned and operated by: Technology Services RPVW S.L. CIF# B57345084
Avda Constitucion 48 Bajos Alaro 07340 Baleares SPAIN
Tel:+34 971518362    Fax: +34 971518368    eMail: