metatag.api.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/metatag.api.php b/metatag.api.php index 3f2ac99..c097514 100644 --- a/metatag.api.php +++ b/metatag.api.php @@ -66,10 +66,54 @@ */ /** - * + * Provides a default configuration for metatag intances. + * + * This hook allows modules to provide their own metatag instances which + * can either be used as-is or as a "starter" for users to build from. + * + * This hook should be placed in MODULENAME.metatag.inc and it will be + * auto-loaded. MODULENAME.metatag.inc must be in the same directory as the + * .module file which must contain an implementation of hook_ctools_plugin_api + * with the same code as in metatag_ctools_plugin_api(). + * Watchout: This hook requires hook_ctools_plugin_api to be implemented in + * in your module as well. + * + * The $config->disabled boolean flag indicates whether the metatag instance + * should be enabled (FALSE) or disabled (TRUE) by default. + * + * @return + * An associative array containing the structures of metatag instances, as generated from + * the Export tab, keyed by the metatag config name. + * + * @see metatag_metatag_config_default() + * @see metatag_ctools_plugin_api() */ function hook_metatag_config_default() { - return array(); + $configs = array(); + + // Begin copy and paste of output from the Export tab of a metatag. + $config = new stdClass(); + $config->instance = 'config1'; + $config->api_version = 1; + $config->disabled = FALSE; + $config->config = array( + 'title' => array('value' => '[current-page:title] | [site:name]'), + 'generator' => array('value' => 'Drupal 7 (http://drupal.org)'), + 'canonical' => array('value' => '[current-page:url:absolute]'), + 'shortlink' => array('value' => '[current-page:url:unaliased]'), + ); + $configs[$config->instance] = $config; + + $config = new stdClass(); + $config->instance = 'config2'; + $config->api_version = 1; + $config->disabled = FALSE; + $config->config = array( + 'title' => array('value' => '[user:name] | [site:name]'), + ); + $configs[$config->instance] = $config; + + return $configs; } /**