Menu item link to open in new tab

Started by shorel, March 24, 2023, 01:19:57 PM

Previous topic - Next topic

shorel

I am using SMF 2.1.3

I have followed the advice in the following link:
https://wiki.simplemachines.org/smf/Buttons_-_How_do_I_add_buttons_to_SMF_2.0

That works fine but I would preferably like the new link to open in a new tab. 
I've tried a few options based on my basic php skills but have failed.  I'd appreciate some help.  Many thanks

Sir Osis of Liver

In Subs.php, add target to button array.  Like this -


'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
'show' => $context['allow_search'],
'target' => '_blank',
'sub_buttons' => array(
),
),

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shorel

Thanks so much -- I should have sussed that really.

Appreciate your help and sorry for the delay getting back to you.

Advertisement: