Former Member
inherit
guest@proboards.com
165779
0
Apr 19, 2024 16:06:21 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jun 12, 2018 23:15:35 GMT -8
Morning guys
Can someone please remind me how to make a custom nav bar link to open in a new tab rather than in the current tab?
I have tried the below, but it doesnt work and just reloads the current tab.
<a href="LINK HERE" target="_blank">
Thanks Dave
|
|
#eb7100
1480
0
1
Apr 19, 2024 8:55:18 GMT -8
Craig
208,852
September 2001
cmdynasty
|
Post by Craig on Jun 13, 2018 2:26:00 GMT -8
Hi Dave. Hope you are well That should be it, so don't know why it is not working for you. Are we able to see where you have put it?
|
|
inherit
252032
0
Apr 4, 2024 21:43:14 GMT -8
Retread
Tribbial Pursuit.
5,014
January 2018
retread
|
Post by Retread on Jun 13, 2018 4:28:29 GMT -8
Morning guys Can someone please remind me how to make a custom nav bar link to open in a new tab rather than in the current tab? I have tried the below, but it doesnt work and just reloads the current tab. <a href="LINK HERE" target="_blank"> Thanks Dave Hello Dave B I think I understand what's going wrong but I don't know how to get around it. Are you doing this through Admin Home> Settings> Forum Settings> Navigation> ? If so, you have a field for Name and another for URL The link is being created by surrounding those with the necessary syntax. For instance NAME and /URL would result in: <a href="/URL "> NAME </a>
(all the parts in red are automatically applied) If you attempt to put something like <a href="/URL" target="_blank"> in the field for URL the result wouldn't make sense so it gets replaced with a null. And the output looks like this: <a href=""> NAME </a> The closest you could get would be to use this in the URL field. /URL" target="_blank Unfortunately each quotation mark " in the URL field gets replaced with with something that will be displayed as a quotation mark on the output page or if used in BBCode but won't function in html. And I don't know how to get around that substitution.
|
|
#e61919
Support Staff
224482
0
1
Apr 19, 2024 14:58:17 GMT -8
Scott
23,257
August 2015
socalso
|
Post by Scott on Jun 13, 2018 6:31:30 GMT -8
Dave B , See if this works for you: Go to the CSS for your theme and add this at the end: a.navmenuplus { display: inline-block; padding: 0 .75em; color: #ffffff; font: 1em "Trebuchet MS",Verdana,Arial; text-decoration: none; text-shadow: none; line-height: 31px !important; } Then go to the forum wrapper layout template for the same theme. Look for this block of code: {foreach $[navigation.menu]} <li> <a{if $[navigation.menu.active]} class="state-active"{/if} href="$[navigation.menu.href]"{if $[navigation.menu.accesskey]} accesskey="$[navigation.menu.accesskey]"{/if}> $[navigation.menu.name] {if $[navigation.menu.notification.total]} <div class="tip-holder" onclick="window.location='$[navigation.menu.notification.href]'; return false;"> <div class="tip-number">$[navigation.menu.notification.total]</div> <span class="tip"></span> </div> {/if} </a> </li> {/foreach} On a new line right after the {/foreach} of the above code, add this: <a class="navmenuplus" href="YOUR URL" target="_blank">MENU ITEM NAME</a> Change the YOUR URL and MENU ITEM NAME respectively to the desired link and nav menu name. Since I don't know the forum and theme you are using I was unable to tailor the CSS accordingly to match. You'd need to make that adjustment yourself. Possible there's another solution out there, but tested this and it works on my forum.
|
|
Former Member
inherit
guest@proboards.com
165779
0
Apr 19, 2024 16:06:21 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jun 13, 2018 12:14:01 GMT -8
Evening all Apologies for the lack of details and sorry was at work all day Thanks for the responses Craig, Retread and im good thanks. Cheers Scott that does exactly what i need it to. Maybe an idea for the Navigation Menu is a setting to choose whether links open in a new tab or not Thanks Dave
|
|
#e61919
Support Staff
224482
0
1
Apr 19, 2024 14:58:17 GMT -8
Scott
23,257
August 2015
socalso
|
Post by Scott on Jun 13, 2018 12:21:23 GMT -8
Excellent Dave B, glad the solution worked for you. I like your suggestion about the nav settings and so labeled this a Feature Request. Cheers!
|
|
Former Member
inherit
guest@proboards.com
165779
0
Apr 19, 2024 16:06:21 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jun 13, 2018 12:23:58 GMT -8
Excellent Dave B , glad the solution worked for you. I like your suggestion about the nav settings and so labeled this a Feature Request. Cheers! Thanks Scott Seems a lot of work for something that could be so simple Dave
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,775
January 2015
msg
|
Post by Lynx on Jun 13, 2018 16:15:15 GMT -8
Dave B, An easy workaround would be the Navbar Links plugin - it has an option of whether to open in the same tab or a new tab in the Target option in the UI. Note that all links added in the plugin get appended to your normal navbar (from Admin > Settings > Forum Settings > Navigation). If you want to try the plugin, the support thread is HERE if you've got any questions.
|
|