Issue #664Opened December 20, 2017by SwithFr0 reactions

[Solved] Component recognition

Question

Hi. Hi,

I created an "img-link" component that as its name indicates is a link that contains an image.

When I insert my component into the editor everything works perfectly. But when I want to edit my template afterwards. It no longer recognizes my component as an "img-link" but as a simple image, and therefore no longer has the behaviors I defined for it (custom traits).

I tried to use a specific isComponent function :

isComponent: function ( el ) {
     if ( el.classList && el.classList.contains( 'img-link' ) ) {
        return { type: 'img-link' };
     }
}

But it doesn't work.

Any idea ?

Answers (3)

SwithFrDecember 20, 20170 reactions

Thank with a plugin it's works !

lock[bot]September 18, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.