Feature Link Block

Is there a way to get the button on the “feature link” block to open the link in a new tab or window?

Take a look inside /concrete/blocks/feature_link/view.php :

//Optionally use the setAttribute() function to add additional attributes
//$button->setAttribute('target', '_blank');

You should copy that view.php file, give it a different name, newwindow.php for instance, then drop it in your site at /application/blocks/feature_link/templates/newwindow.php

You can then modify that file without being bothered by core updates. In your case, just uncomment that line, apply the template to your block, and you’ll have your links in new tabs/windows

1 Like

ok, I think I got it. So in this case (your example), the template would be named “newwindow” ?

Thank you for your help/time~!

Correct your new template would then be named newwindow. Likewise, if you have a block which needs view.css and view.js files, create a folder named newwindow at that location, and then place your view files inside that folder and you’d also still have a template named newwindow!!

1 Like