GetmeUK / ContentTools

A JS library for building WYSIWYG editors for HTML content.
http://getcontenttools.com
MIT License
3.95k stars 395 forks source link

Identify DOM element by class #412

Closed simonmannsfeld closed 7 years ago

simonmannsfeld commented 7 years ago

My intention is to add the bootstrap grid as elements to the Tool shelf. Here we got three divs with another class: .container .row, and .col's.

How can I decide between them?

anthonyjb commented 7 years ago

@simonmannsfeld if I understand your question then you typically add a tag type data attribute to the element, for example:

<div class="container" data-ce-tag="container">
    <div class="row" data-ce-tag="row">
        <div class="col" data-ce-tag="col">
        </div>
    </div>
</div>

(Worth having a read through the section on tag names: http://getcontenttools.com/api/content-edit#tag-names)