Hello,
Thanks for the feedback. Can you please elaborate on what “HTML Anchor” is in Block Types? I’m not sure to understand your request.
Thanks!
Regards.
Hi
The HTML anchor appears under the blocks Advanced tab (where you input class names) – usually we can add to ACF blocks via the supports parameter within acf_register_block_type as 'supports' => array('anchor' => true). The anchor is then returned using $block['anchor'] in the template, and we can use it as a page anchor.
But it doesn’t look like it’s supported by your plugin? If not, is there a way I can hook in to add the anchor support for blocks created through ACF Extended?
Thanks
Hello,
Okay I see, thanks!
I added it to the Trello Board: https://trello.com/c/o1fqF149/437-dynamic-block-type-add-anchor-setting. The setting will be added in the next patch!
Regards.
Great stuff, thanks!
Could you give me an idea of when the next patch is scheduled, just so I can inform my client when we can implement the features he needs?
Thanks
Hello,
The next update will be pretty big, so I prefer not give any ETA. But we’re pretty close of it. Just to let you know, you can use the acf/register_block_type_args filter in order to add or override any settings of the the Dynamic Block Type module.
Here is a code example:
add_filter('acf/register_block_type_args', 'my_acf_register_block_type_args');
function my_acf_register_block_type_args($args){
// Target my-block-type
if($args['name'] !== 'acf/my-block-type')
return $args;
$args['supports']['anchor'] = true;
return $args;
}
See documentation: https://www.advancedcustomfields.com/resources/acf-register_block_type_args/
Hope it helps!
Regards.
Thanks! Just in case anyone else needs to use this, anchor needs to go in the support array:
$args['supports'] = array(
'anchor' => true
);
Thanks for your help!
Hello,
Oh yeah that’s right. I updated my answer 🙂
Regards.