Making your own customisations to the default theme

  • strict warning: Non-static method view::load() should not be called statically in /home/prosepoint.org/bzr/public_html/profiles/prosepoint/modules/views/views.module on line 879.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /home/prosepoint.org/bzr/public_html/profiles/prosepoint/modules/views/handlers/views_handler_argument.inc on line 0.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/prosepoint.org/bzr/public_html/profiles/prosepoint/modules/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/prosepoint.org/bzr/public_html/profiles/prosepoint/modules/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_filter_node_status::operator_form() should be compatible with views_handler_filter::operator_form(&$form, &$form_state) in /home/prosepoint.org/bzr/public_html/profiles/prosepoint/modules/views/modules/node/views_handler_filter_node_status.inc on line 0.
  • strict warning: Non-static method view::load() should not be called statically in /home/prosepoint.org/bzr/public_html/profiles/prosepoint/modules/views/views.module on line 879.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home/prosepoint.org/bzr/public_html/profiles/prosepoint/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 0.
  • strict warning: Declaration of date_api_filter_handler::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home/prosepoint.org/bzr/public_html/profiles/prosepoint/modules/date/includes/date_api_filter_handler.inc on line 0.
  • strict warning: Non-static method view::load() should not be called statically in /home/prosepoint.org/bzr/public_html/profiles/prosepoint/modules/views/views.module on line 879.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/prosepoint.org/bzr/public_html/profiles/prosepoint/modules/views/plugins/views_plugin_row.inc on line 0.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/prosepoint.org/bzr/public_html/profiles/prosepoint/modules/views/plugins/views_plugin_row.inc on line 0.
Example subtheme released

Over the last few weeks, we've received questions from interested users about ProsePoint themes, particularly about how ProsePoint themes differs from Drupal themes, and how to customise the default theme that comes with ProsePoint (tma2). After a few ad-hoc replies, we've decided it was time to devote some attention to ProsePoint themeing.

In hindsight, we always knew users would enquire about themes, we knew users will want to change something about their theme. We just didn't expect it to happen yet.

(Oops. 'Should have seen this coming.)

We've since added a themeing section to the user guide, and with this article, we're now going to release an example of customising the default ProsePoint theme.

Breithorn_Panorama.jpg

A header image from the subtheme (Source: Wikimedia Commons)

To understand this example, you will need to know some CSS. At a minimum, making your own customisations will require editing CSS files. For advanced themeing changes (which are not demonstrated here), you will also need to know some PHP. Sorry, there's not much we can do about that.

Before you proceed, you may like to download the example subtheme tma_custom (about 726KB). This file is hosted at launchpad until or if we eventually find a more permanent location. Uncompress the package and place it under .../sites/all/themes or .../sites/default/themes (so that it becomes .../sites/.../themes/tma_custom) . If you then visit Administer // Site building // Themes, you should see the new subtheme in the themes list.

This example is implemented as a subtheme of the default theme (which is tma2). Subthemes are a really useful feature. You only need to put in the changes you want, and the subtheme inherits everything else from the base theme (In fact, tma2 itself is subtheme of the generic Drupal theme tma, but let's not digress). This makes things easy to manage, as you only have to deal about your own customisations.

This example subtheme has two changes. The header images have been completely replaced, and the colour scheme of the menu bar has been changed to a medium red. You may not agree with these changes (and in fact, we don't expect you to), but they are intended for illustrative purposes.

Nuit_de_fete_Place_Flagey.jpg

And another one (Source: Wikimedia Commons)

There are about 25 prepared header images in the tma_custom/headers directory. Most of them were cropped from scenic panoramas because it wasn't easy finding other suitable images to fit the slender dimensions of the header. The CSS file tma_custom.css has lots of comments and examples of how to assign header images to specific sections or pages of your site. If you look in it, you can modify the declarations (or comment them out) as you see fit.

The same CSS file also customises the colour scheme of the menu bar. Again, it's a case of looking in it yourself and inserting your own CSS styles to override those of the base theme.

This example subtheme only demonstrates CSS based customisations (although you can already do a lot with just CSS). It is also possible to change the html output of the theme, but that involves PHP and overriding template files, and we'll leave that for another article.

We have a port of another Drupal theme in the pipeline, and when that's ready, we'll describe more advanced themeing examples involving PHP template files. Please keep an eye out for it.

Oh, and thanks for using ProsePoint!

Mandorle_sgusciate.jpg

And one more for good measure (Source: Wikimedia commons)