Community Documentation

Step 5: Components

Last updated April 11, 2012. Created by alexweber on April 5, 2012.
Log in to edit this page.

Here you will learn about Zentropy components.

This page is under construction.

Advanced Drush Integration

If you use Drush 5.0-rc2 or newer you can download and install optional components using Drush:

drush zdl --help will list the available components.

drush zdl "theme_machine_name" "component_name" will download and automagically install the component into your subtheme.

You can also optionally specify one or more components to be automatically added and installed in new subthemes: drush zns "Theme Name" "theme_machine_name" --with-component1 --with-component2 etc...

Components are frequently-used 3rd party libraries that can't be distributed with Zentropy due to licensing restrictions. They are pre-integrated with Zentropy and can be easy enabled/disabled with one line.

Available components:

*Important: We include the development version of Modernizr. Please download a custom build before putting your website in production.

Disabling an enabled component

drush zdis "theme_machine_name" "component name"

Re-enabling a disabled component (just re-run the command to download it!)

drush zdl "theme_machine_name" "component_name"

Manual installation

Follow these steps in order to manually install a component:

  1. Pick a component
  2. Open zentropy.drush.inc in Zentropy's main folder
  3. Find the function _zentropy_list_components()
  4. Locate the array key with the same name as the component you want to install and copy it into your favorite text editor
  5. Each key in the nested array contains important information regarding the component
  6. Download the component manually, you can find the link in the "url" key
  7. The directory where you should extract it is the value of the "dir" key. NOTE: It has to be under your libraries directory: sites/all/libraries/[dir]
  8. Finally, copy the value of the "replace" key
  9. Now open your Subtheme's template.php file
  10. Inside the function SUBTHEME_preprocess_html(), look for
  11. Look for a commented code block with your component's name
  12. Paste the "replace" text over the commented code block
  13. Done!

Example: Manually enabling the Modernizr component:

    'bgiframe' => array(
      'name' => 'jQuery bgiframe',
      'url' => 'https://github.com/downloads/brandonaaron/bgiframe/bgiframe_2.1.2.zip',
      'type' => 'get',
      'dir' => 'jquery.bgiframe',
      'replace' => "drupal_add_js('sites/all/libraries/jquery.bgiframe/jquery.bgiframe.js', array('scope' => 'header', 'group' => JS_LIBRARY, 'every_page' => TRUE));",
      'instructions' => "Check out http://brandonaaron.net/code/bgiframe/docs for instructions on how to use bgiframe.",
    ),
  1. Download the plugin from: https://github.com/downloads/brandonaaron/bgiframe/bgiframe_2.1.2.zip
  2. Extract it to sites/all/libraries/jquery.bgiframe
  3. Find #bgiframe# in your Subtheme's template.php
  4. Replace it with drupal_add_js('sites/all/libraries/jquery.bgiframe/jquery.bgiframe.js', array('scope' => 'header', 'group' => JS_LIBRARY, 'every_page' => TRUE));
nobody click here