Minim

Component ID

1944390

Component name

Minim

Component type

theme

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Minim is a lightweight theme that uses the Twig template engine. It's also a personal experiment in separating as much logic from the presentation layer as possible. Minim is not meant to be a complete theme, but a fast and clean foundation.

Minim might be a good fit for you if:

  • You want to keep logic out of the presentation layer (separation of concerns).
  • You are interested in using a DRY, KISS and OO CSS approach.
  • You want template parity between PHP and Javascript (to be able to render the same template with either language).
  • You want to fiddle around with Twig before Drupal 8 launches.
  • You are comfortable with Drupal's theme layer.

Installation

  1. Install ReneB's Twig for Drupal. If you don't want to modify core you can place the engine file in sites/all/themes/engines/twig/twig.engine. Then perform the following three hacks to TFD
  2. In sites/all/libraries/TFD/Extension.php Delete bad theme call on line 12.
  3. Rename sites/all/libraries/TFD/Nodevisitor.php sites/all/libraries/TFD/NodeVisitor.php
  4. Rename sites/all/libraries/TFD/Node/functionCall.php to sites/all/libraries/TFD/Node/FunctionCall.php
  5. Clone yourself a copy of Minim and put it in sites/all/themes/minim.
  6. Before enabling, be sure to select a private file directory (admin/config/media/file-system). Twig for Drupal places its precompiled templates there. Not setting a private file directory will result in a gnarley WSOD that is hard to get rid of.
  7. Enable as usual.

Suggested Use

Minim is meant to be the base for your theme, but is not a base theme (yet). Just go to town on the copy you cloned or rename/find and replace it as you wish. Minim suggests a theming pattern where there is little to no logic in your templates. If you need to manipulate content or use logic, preprocess functions are suggested. The includes directory is expressly for breaking out preprocess functions for potential core, minim_theme and Views templates.