Theming

Introduction
Drupal sit on top of a really powerful theming engine. Nearly anything can be templated and themed before being displayed to the end users. What we will focus on in this page are the things in OSF for Drupal that can be themed. There are two kind of templates that can be created:
 * Templates that will be used to theme specific individual resources' pages based on their type
 * Templates that will be used to theme search results based on their type

Templates Selection
In OSF for Drupal, everything that are manipulated are [resource] entities. Any entity has at least one or multiple types. These types are defined, and hierarchized in an ontology. It is these types that will determine which template will be used by Drupal to theme and display one of these entities.

Let's use this simple, fictive, classes hierarchy that as been defined in one of the loaded ontology to show how the templates are selected by OSF for Drupal:

Now let's assume that we have a the following template files that have been created, and that are located in the  folder of the default theme:

Theming individual resources pages
Templetes locations:
 * /modules/osf/modules/osf_entities/
 * [default-theme-folder]/templates/

Theming OSF SearchAPI results
Templetes locations:
 * /modules/osf/modules/osf_searchapi/
 * [default-theme-folder]/templates/

Theming OSF SearchProfiles results
Templetes locations:
 * /modules/osf/modules/osf_searchapi/
 * [default-theme-folder]/templates/

External Drupal Theming Resources

 * Drupal's Core Theming Guide