Download hexagon-7.x-2.0-beta1.tar.gztar.gz 84.02 KB
MD5: 1773bca1199770dd7b51252371a13930
SHA-1: 17d737aae18ab31edc4b7cd17bb1d7b0b04174bd
SHA-256: 9e530aed3cb76928de02b89e7655e8a04624046caff35f995bdec38ba6df9a56
Download hexagon-7.x-2.0-beta1.zipzip 102.85 KB
MD5: 80d31ad6d926ce385b31b6687afe52dd
SHA-1: 85a324fd0ed0129bb44d8b89fd2ab45cce5d4ce7
SHA-256: ca7a7c35ca4219c453d3970e28bd6a495fd6d59fd2bec0eb762c44b038847d46

Release info

Created by: dvessel
Created on: 2 Jan 2012 at 14:33 UTC
Last updated: 10 Jan 2012 at 23:51 UTC
Core compatibility: 7.x

Release notes

Feature Toggles

This is related to theme feature toggles provided by Drupal core. Themes and plug-ins can define sets of features adding to the pool of available features.

They must be set from the theme .info or plug-in .pinfo file.

feature set[FEATURE_KEY_1] = FEATURE_NAME_1
feature set[FEATURE_KEY_2] = FEATURE_NAME_2
; etc…

The FEATURE_KEY is the machine readable name and FEATURE_NAME is the human readable name used in the theme settings form. All feature keys must be unique and they cannot be overridden.

If the features are set within a plug-in, enabling it through the theme settings form will enable the plug-in. If none of the features are enabled for a plug-in, none of the code associated with the plug-in will ever load. This can keep code associated with the feature very focused on its purpose.

To get the state of the feature toggle, a simple call to hex_settings() is all that's needed. Prefixing toggle_ with the FEATURE_KEY defined from the info file, e.g., hex_settings('toggle_FEATURE_KEY'). Features defined from plug-ins must be prefixed with the plug-in name (hex_settings('PLUGIN_KEY.toggle_FEATURE_KEY')). This is required for any setting that's specific to a plug-in to keep its association clear.

When the list of features displayed in the theme settings form grows out of control, it can be limited by defining the features you want to make available in the theme .info file. This is the default behavior in Drupal core and this pattern is continued here. If this is not set, all available features will be visible.

features[] = FEATURE_KEY_1
features[] = FEATURE_KEY_2
; etc…

Note that the defined order set from the info file will be reflected in the theme settings form.

Plug-in System

Plug-ins are very simple to set-up. All that is required is a .pinfo file. An optional file can host the php code which will load only when the plug-in is active.

Here is an example .pinfo file:

; Human readable name. This should always be set.
name = My Plug-in

; Description, not used currently but could be used in the future.
description = Description of my plug-in.

; The hex api version. This is required.
hexapi = 2.x

; If protected, overriding the plug-in is not possible. This is useful when the
; plug-in provides critical features that should not be altered. Overriding is
; as simple as copying the plug-in hosted in a parent theme and placing it into
; a sub-theme.
protected = false

; Setting this to true will automatically enable it when it doesn't depend on
; other components or when all defined dependents are already available.
auto enable = false

; Plug-in dependencies. If this plug-in is explicitly enabled, the dependencies
; will enable themselves. 'auto enable' will not enable dependent plug-ins.
dependencies[] = foo

; Other dependencies. It can contain themes or modules. This is extensible.
requirements[] = my_theme
requirements[] = views

; Add styles just like it's done in theme .info files…
stylesheets[all][] = style.css

; …or scripts.
scripts[] = script.js

The should host functions that should always be available when it is active. Plug-ins and

Cache API

Code Registry


The selected release is the release that will be used for automated testing. Optional projects are only used for testing.


No required projects


No optional projects