This project is not covered by Drupal’s security advisory policy.

Integrate/ingest a well-structured front-end (KSS) style guide.

╰( ⁰ ਊ ⁰ )━☆゚.*・。゚

Map Drupal fields through your existing front-end templates.

Organize your front-end into components? Use an automated, living style guide (KSS), want it synced into Drupal? Want to use modern templates (Handlebars) for CMS data? Now you can!

Keep a clean front-end structure and make Drupal aware with convenient developer APIs; render CMS content through Handlebars templates! Map entity fields or fieldgroups directly into your loaded components without writing a line of new code.

Under active development, dev release recommended. The getting started experience is a known weakness, help is welcome.

Need a KSS Boilerplate?

Styleguide stuck with unexpected data? Quick fix...
drush vdel componentize_list -y

Documentation!

Active Work / Wanna help?

More details:
Web best-practices have tilted toward creating reusable, self-contained, front-end components that can be represented in a living style guide. There are lots of tools for this outside Drupal. This module seeks to...

  • Ingest a set of structured components, written in the KSS standard.
  • Use component templates to render Drupal content, via Handlebars.
  • Provide easy ways for admins to make use of front-end components: Fieldgroups with field mapping, Context alteration, etc.
  • Offer convenient object-oriented APIs for devs to access, register, render and control components.

Dependencies:

Recommended Companions: Read the docs

BONUS: Object-oriented developer interface. Few simple examples...

Developer APIs

Render data via component...

//template.hbs
<div class="thing {{ modifier--class }}">
  <span class="thing_label">{{ subject }}</span>
  <a href="{{ url }}" class="thing__title"><h4>{{ subject }}</h4></a>
</div>
//my_module.module
$component = ComponentFactory::create('section.thing');
$component->setModifier('thing--modifier');
$component->render(array(
  'label' => $entity->bundle,
  'subject' => $entity->title,
  'url' => $metadata_wrapper->field_thumbnail->value()
));

Other tools...

// Access all components to render.
$components = componentize_list();
$components['section.another-thing']->render($my_data);
// Get a shallow list.
$list = componentize_list(TRUE);
// Add field handlers to wrangle data into templates.
class ComponentFieldMyType extends ComponentField {
  public function getValues($item) {
    return _wrangle_data($returns['safe_value']);
  }
}

Road Map: (issues)

Supporting organizations: 

Project information

Releases