Developers

Events

Table Maker provides events for extending its functionality. Modules and plugins can register event listeners, typically in their init() methods, to change Table Maker’s behaviour.

Field Events

The registerRichTextLinkTypes Event

The event that is triggered when registering the element types that rich-text cells can link to, so a module or plugin can add its own. See Custom Link Types for a complete example.

Add element type class names to $event->types, or remove the built-in entry, category and asset types.

use craft\events\RegisterComponentTypesEvent;
use modules\sitemodule\elements\Product;
use verbb\tablemaker\fields\TableMakerField;
use yii\base\Event;

Event::on(TableMakerField::class, TableMakerField::EVENT_REGISTER_RICH_TEXT_LINK_TYPES, function(RegisterComponentTypesEvent $event) {
    $event->types[] = Product::class;
});