bigspring / monolith

A starter theme for WordPress built with Twitter Bootstrap
MIT License
9 stars 1 forks source link

Builder path/class name issue #373

Closed dmseaton closed 8 years ago

dmseaton commented 8 years ago

The first argument passed to the builder is used to locate the layout path of the organism - for this reason it's often convenient to pass a path to the class (e.g. frontpage/block-grid where a custom bg to be used on the frontpage is found at organisms/frontpage/block-grid.php).

However, the layout path is also used directly in class names, prepended with builder-. This means that any time a path like frontpage/block-grid is passed to the builder, the organism markup will include an element with a badly-formed markup:

<div class="builder builder-frontpage/block-grid">

WP's sanitize_title() function might be suitable for resolving this cleanly.

jrgmartin commented 8 years ago

sanitize_title() sounds like a good plan. Happy for you to hotfix as this seems like a quick but important one to avoid invalid markup.