jacksleight / statamic-bard-mutator

This Statamic addon allows you to modify the data and tags rendered by the Bard fieldtype, giving you full control over the final HTML.
https://statamic.com/addons/jacksleight/bard-mutator
MIT License
19 stars 3 forks source link

Add Bard field object to meta data #20

Closed jacksleight closed 1 year ago

jacksleight commented 1 year ago

Adds the Bard fieldtype object to the metadata, eg:

Mutator::html('heading', function ($value, $data, $meta) {
    $meta['bard'] // Field object
    $meta['bard']->handle() // Field handle
    $meta['bard']->get('display') // Field config value
    $meta['bard']->parent() // Parent entry object
});