-
Patrick
Hi Support,
When using dynamic data feature with Link on Headline Block for example, I am not able to add target=”_blank” as an attribute or activate this option. Please allow target as custom attribute.
Thanks
-
David
Hi there,
it is on our list, for now you can do it with some PHP.
For example:add_filter( 'render_block', function( $block_content, $block ) { if ( ! is_admin() && ! empty( $block['attrs']['className'] ) && strpos( $block['attrs']['className'], 'open-new-tab' ) !== false ) { $my_search = 'href="'; $my_replace = 'target="_blank" href="'; $new_content = str_replace( $my_search, $my_replace, $block_content ); return $new_content; } return $block_content; }, 10, 2 );
Once added select the Headline block and in Advanced > Additional CSS Classes add:
open-new-tab
-
Patrick
Hi David,
Sorry for my late reply. Thanks for your update and the provided code.
Appreciate your support.Best
-
David
You’re welcome!
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.