Open navigation buttons in new tab?

Started by JoeBrodsky, July 16, 2014, 03:41:00 PM

Previous topic - Next topic

JoeBrodsky

Hey guys I'm trying to figure out when you click a button on the navigation bar for it to open a new tab rather than taking you away from the actual website. 

I posted a picture below, for example when I click "Eastern Conference"  I want the google doc to open up in a new tab rather than taking you off the website.

Deaks

~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

JoeBrodsky

Quote from: Μπράιαν on July 16, 2014, 03:58:13 PM
how did you add them?

I have some of them left normally on the original navigation bar, the others such as League Docs and Rosters tabs are used from the
6 Custom Buttons mod

Deaks

according to the mod you just insert full url for external links to make them open in new window well I dont think you can with that mod maybe need to add them all in subs.php
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

JoeBrodsky

Quote from: Μπράιαν on July 16, 2014, 04:06:42 PM
according to the mod you just insert full url for external links to make them open in new window well I dont think you can with that mod maybe need to add them all in subs.php

What would I need to add in the subs.php to get the links to open in new tabs?

Deaks

firstly do you know how to add new tabs in subs.php?
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."


Kindred

One thing...   if you are using a mod and you have quesitons on how to use that mod or how to modify the mod to do something, you really need to be asking those questions in the support topic dedicated to that mod.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Deaks

How do I add buttons to SMF 2.0?

This will help :)

To make it open in new window you need to add

                  'target' => "_blank",

To the code for a new window
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Steve

Quote from: Μπράιαν on July 16, 2014, 04:23:53 PM'target' => "_blank",

Is that a typo or something new or the same as target="_blank" which is what I thought it was. That's been from years ago though.
DO NOT pm me for support!

Matthew K.

Same thing. I'd use single-quotes though to be consistent.

Kindred

AFAIK, you need the single quotes, because in this case, the target is part of the button array....  not an html value
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

br360

Like Bryan said; the 'target' => "_blank", is the way to go. Click on the link below, and it will show you exactly where to put it in your subs.php

http://www.simplemachines.org/community/index.php?topic=392714.msg3371296;topicseen#msg3371296

Steve

Actually, I meant this bit:

=> instead of just =
DO NOT pm me for support!

Deaks

Steve

target="_blank" is for html

as in the subs the button is not being built by html its slightly different
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Steve

DO NOT pm me for support!

Matthew K.

Quote from: Kindred on July 16, 2014, 05:07:53 PM
AFAIK, you need the single quotes, because in this case, the target is part of the button array....  not an html value
You can use single quotes or double quotes as array values. It doesn't matter.

Kindred

Lab... you missed my point...  Steve was asking about using title = instead of 'title' =>
I caught and covered the explanation for the first bit (the quotes) and br30 saw the part that I missed (the = versus =>) and clarified that.. :)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

JoeBrodsky

Quote from: br360 on July 16, 2014, 05:34:24 PM
Like Bryan said; the 'target' => "_blank", is the way to go. Click on the link below, and it will show you exactly where to put it in your subs.php

http://www.simplemachines.org/community/index.php?topic=392714.msg3371296;topicseen#msg3371296

Thanks guys this was so easy! 

Advertisement: