Adaptivetheme include a number of template overrides to support its HTML5 output and to ease code management by offering features to reduce the reliance on template suggestions and allowing you to theme from preprocess and process functions with more granularity and control.
This page includes a brief overview of each template and what changes have been made to override Drupal 7 cores output. Some templates have more extensive documentation due to additional features provided by that template - also see the relevant preprocess and process functions for each template if linked to (the docs are currently under construction, its worth checking back to see if they have been added).
AT 7.x-3.x makes heavy use of preprocess functions and extends them with a number of helper functions to ease code management via various layers of abstraction. Where appropriate the docs will link to additional pages documenting these abstraction layers. One of the largest is the
load system, which abstracts the loading of CSS and JS files from
load.inc and its various file loading functions.
$is_mobile is available to all templates if you install the Browscap module. You can use this to conditionally show or hide content in mobile devices. Adaptivetheme includes special integration with Browscap to enable the $is_mobile bool (returns TRUE if a mobile device is detected), and uses it to power its own Mobile Regions and Blocks feature.
- IE conditional classes on the HTML element, much like HTML5 Boilerplate provides.
$html_attributesvariable that includes the lanaguge and language direction.
$polyfillsvariable that prints IE conditional scripts, which can be added via the info file: see - IE Styles and Scripts.
- For site builders and developer the skip navigation target ID is set through a new variable
$skip_link_target. This can be set in your sub-themes Appearance settings under Extensions > Markup Overrides > Accessibility, with the default set to
$site_logo: Themed logo - linked to front with alt attribute.
$site_name: Site name linked to the homepage.
$site_name_unlinked: Site name without any link.
$hide_site_name: toggle_name boolean, used to toggle the visibility is the site name.
$visibility: Holds the class .element-invisible or is empty. Used to hide the site name if turned off in toggle settings (same behavior as Bartik).
$primary_navigation: Themed Main menu. Uses
$secondary_navigation: Themed Secondary/user menu. Uses
$primary_local_tasks: Split local tasks - primary. Allows you to print the primary local tasks separately from the secondary tasks.
$secondary_local_tasks: Split local tasks - secondary. Allows you to print the secondary local tasks separately from the primary tasks.
$tag: Prints the wrapper element for the main content, either a
This page template that has 100% width wrappers, which effectively divide the page up into sections to you can style with full width backgrounds. To use copy this to your subtheme and rename it to
page.tpl.php, or enable this in theme settings under Extensions > Markup Overrides > Design.
The region template works a little differently and uses variables to print the markup. You can overrides this with a normal template suggestion in your subtheme or theme it from
- $outer_prefix: Outer div with region classes.
- $outer_suffix: Closing element.
- $inner_prefix: Inner div with .region-inner and .clearfix classes.
- $inner_suffix: Closing div.
themeName_process_region()- please see the additional docs on this template.
You can also use a region--sidebar.tpl.php file to theme both sidebars at the same time.
The block template in Adaptivetheme is a little different to most other themes. Instead of hard coding its markup Adaptivetheme generates most of it in
adaptivetheme_process_block(), conditionally printing outer and inner wrappers. This is the same as how region templates work and you can override it with a standard block template suggestion in your sub-theme or theme it from
$outer_prefix: Holds a conditional element such as nav, section or div and includes the block id, classes and attributes.
$outer_suffix: Closing element.
$inner_prefix: Inner div with .block-inner and .clearfix classes.
$inner_suffix: Closing div.
$title: Holds the block->subject.
$content_processed: Pre-wrapped in div and attributes, but for some blocks these are stripped away, e.g. menu bar and main content.
Additional template suggestions are supplied for the menu bar region - please view the full docs page or the actual code in
Last updated 4th July, 2012 - 10:50pm