News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

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(
),
),

Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

shorel

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

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

Advertisement: