wiki:WebTemplateProposal

Version 3 (modified by Christian Beer, 13 years ago) (diff)

--

Proposal for a new general website template

This proposal is in active development, nothing is integrated into BOINC yet!

The current design of the BOINC web pages is a mixture of PHP with HTML that is grown over the years. The tight integration of PHP functions in HTML output makes it very difficult to maintain or change the layout of the individual project site. This proposal aims to separate PHP (application code) from HTML (presentation code) and provide an easy way (for a web designer) to give each project a unique look and feel. The tools described below are still under investigation if and how they could be implemented into BOINC source code.

Smarty template engine (LGPLv3)
To separate application from presentation code, has own simplified syntax to be used in templates (easy to use for webdesigners that don't know PHP), built in caching system, well maintained, good documentation.
Fluid 960 Grid System (GPLv3/MIT) with jQuery JavaScript library (GPLv2/MIT)
This can be used to create standard templates by providing CSS classes for cross-browser support and nice looking, userfriendly JavaScript effects.

All tools can be updated separately after implementing into BOINC source code.

Problems to avoid (currently investigating):

  • make internationalization work with caching (old plugin: Smarty gettext, still usefull?)
  • allow project specific template enhancements or replacement without tampering the standard templates

What using Smarty means:

  • No HTML-Tags in any .php or .inc files needed (read: allowed)
  • Output of .php must be assigned to Smarty-variables that are then replaced in the template files
  • Ouptut of lists must be assigned to arrays that can then be iterated by Smarty within the template (Sample follows)

Steps to migrate to Smarty:

  1. develop a directory structure to separate PHP files, Smarty files, Template files (including Stylesheets) and Image files
  2. document available Smarty functions/modifiers to be used in templates, best practice for using Smarty within PHP files
  3. develop templates based on Grid system for all public visible files (TODO: find a way to test Templates with Smarty but without BOINC server)
  4. implement new directory structure, Smarty and templates into BOINC source
  5. change PHP files to use Smarty templates