[Piwik-trac] [Piwik] #124: Validation XHTML / CSS of the main piwik code
Piwik
trac at piwik.org
Thu Jun 12 19:34:44 CEST 2008
#124: Validation XHTML / CSS of the main piwik code
--------------------+-------------------------------------------------------
Reporter: matt | Owner:
Type: Task | Status: new
Priority: major | Milestone: Future features
Component: Core | Version:
Resolution: | Keywords:
--------------------+-------------------------------------------------------
Comment (by milianw):
Ok, lets start:
= structure/inspiration =
The best template structure I worked with so far is the one of Drupal. If
you have never worked with Drupal before, read http://drupal.org/theme-
guide to get a glimpse. Essentially the most important features are:
* core/modules/plugins are shipped with default CSS + template markup
* via inheritance and overloading mechanisms I can explicitly change the
parts I want. If we have solid, valid, semantic markup users could simply
create new CSS-only themes. But if one small thing needs to be changed, no
problem - overload the theme function and you are done. Same goes for
template files.
* pluggable theme interpreters (i.e. Smarty etc.) - not needed for Piwik
imo.
= how to apply to Piwik =
So how could this be integrated with Piwik? The basic directory structure
seems to exist:
/themes/default
/plugins/home/templates
etc.
Yet, most of those HTML files will need to get updated to be valid and
semantic. Things like <b> inside some error messages for example should be
replaced with <strong> etc.
The only thing what you guys need for modularity is an inheritance /
overloading mechanism similar to the one described above. Additionally I'd
propose that a few common things get moved from the plugin templates to
themes:
- page skeleton / header + footer
- navigation
- basic widget wrapper: title with close button, buttons at the bottom
- possibly more
The first two should be used in both - Home and AdminHome. to get a
consistent look.
== CSS / JavaScript ==
CSS and JavaScript files of plugins should be included in the page
skeleton / header. It is simply forbidden HTML to load CSS via <link> or
<style> inside <body> tags! A simple function call in the controller
similar to Piwik_View should be all we need here. In future these files
could be aggregated to reduce HTTP requests and make the Piwik backend
perform better. Gzipping would be an added bonus.
A special note to JavaScript: It is allowed to include scripts outside of
<head> and a best-practice is even to include them right before </body>.
== General Cleanup ==
To get started I'd like to do some cleanup, i.e. fix glaring omissions of
alt attributes in images, replace ampersands inside links with their
proper & encoding and so forth. Where can I apply for an SVN account?
Or do I have to paste my patches on your mailing list to get some trust
built up?
--
Ticket URL: <http://dev.piwik.org/trac/ticket/124#comment:11>
Piwik <http://piwik.org>
Piwik, open source web analytics software
More information about the Piwik-trac
mailing list