-
yun22222
I use generateblocks query loop, but when I click on the link, it doesn’t open in a new window. Is there a taget blank option?
If not, is there a way to make only the generateblocks query loop link open in a new window?
-
Hi there,
1. Add this PHP Snippet to your site:
add_filter( 'render_block', function( $block_content, $block ) { if ( !is_admin() && ! empty( $block['attrs']['className'] ) && strpos( $block['attrs']['className'], 'open-in-new-tab' ) !== false ) { $myreplace = '<a'; $myinsert = '<a target="_blank" '; $block_content = str_replace( $myreplace, $myinsert , $block_content ); } return $block_content; }, 10, 2 );
2. select the block with the dynamic link and in Advanced > Additional CSS Classes add:
open-in-new-tab
-
danstramer
Hi David,
Any chance this will be added via the UI?Dan
-
David
Hi there,
yes, its on our list of to dos.
Once have the latest alphas out the way we will be revisiting legacy features requests such as this. -
danstramer
Great, thanks!
-
David
You’re welcome
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.