Add-on Developers
Adding Fieldtype Support
Step 1 - Your Field Type must be compatible with Grid
Step 1.b - Depending on the complexity of your fieldtype
var onDisplay = function(cell) {
var isBloqs = cell.hasClass('blocksft-atom');
if (isBloqs) {
var $myFieldtype = $('.my-fieldtype');
$myFieldtype.find('[name]').each(function() {
var $field = $(this);
var blockId = $field.closest('.blocksft-block').data('id');
var eleName = $field.attr('name');
$field.attr('name', eleName
.replace(
/blocks_new_block_\d+/gm,
blockId
));
});
}
};Step 2 - Opt in for Bloqs Support
Step 3 - Test
Hooks
blocks_discover_fieldtypes
blocks_discover_fieldtypesblocks_post_save
blocks_post_saveLast updated