Log in

View Full Version : Forum Home Enhancements - Dropdown Menu box for Links/Urls


UKBusinessLive
12-30-2008, 10:00 PM
As a result of this post https://vborg.vbsupport.ru/showthread.php?p=1697782#post1697782

I've come up with a small modification that will allow admins to include a small dropdown box in the forum discription. With this mod you will be able to add a few or hundreds of urls and links without filling up your forum.

https://vborg.vbsupport.ru/external/2009/08/24.png
https://vborg.vbsupport.ru/external/2009/01/57.png

This is really easy, all you need to do is to copy the following code to notepad on your PC and save it as subnav.js


function go_nav() {

if (document.getElementById && document.createTextNode) {

var user_link = document.getElementById("my_links").value;

window.location = user_link;

return false;

}

}



or you can just download the zip file ;)

then you need to upload the subnav.js file to your forums root directory.

The next stage is the code where you edit your urls etc...

<div id="drop_box_nav">
<form action="#" onsubmit="return go_nav();">
<select name="my_links" id="my_links">
<option value="http://www.ukbusinesslive.co.uk">UKBusinesslive Store</option>
<option value="http://www.ukbusinesslive.co.uk/topsite">Topsite</option>
<option value="http://www.google.com">Google</option>
<option value="http://www.ukbusinesslive.co.uk/links/">UKBL Links</option>
</select>
&nbsp;&nbsp;
<input type="submit" name="sub_nav" id="sub_nav" value="Go to URL" />
</form>
</div>
<script type="text/javascript" src="subnav.js"></script>




Within that code you need to edit your urls and description in the option values

<option value="http://www.ukbusinesslive.co.uk">UKBusinesslive Store</option>


I've only done 4 in the above but you can add as little or as many as you need by simply adding more option values as in the code above.

Once you've saved your edit, you can upload it to a forum, what i did was to create a new forum called "Quick Links" and then paste all of that code into the Forum Description.

Thats all there is to it, Feel free to experiment with this and remember to post a link here if you want to show off your new dropbox.

Enjoy

:D

*****************************UPDATE*************** *******************
4th Jan 2009

Please find below an .xml file, This is the Menubox done within a Module for vBa

It's the actual module with the default url still in place. (You need to edit these - Unless you want a link to my site :D)
Anyone with vBa3 can upload it via the vBa control panel.
Lower versions of vBa may need to edit the .xml file.
REMEMBER you still need to upload the subnav.js file to your forum root

Many Thanks to Mal for this Code ;)

Enjoy :D
*****************************UPDATE*************** *******************

12 January 2009

To Open in new Browser Window

To get the link to open in a new browser window, what you do is add the target="_blank" attribute to your link tag, like this in your Menu Links area

<option value="http://www.ukbusinesslive.co.uk" target="_blank">UKBusinesslive Store</option>

If you do that to the ones that you want to open in a new window, then you don't navigate away from your site ;)

https://vborg.vbsupport.ru/external/2010/01/30.png

:D

UKBusinessLive
12-31-2008, 12:51 PM
:D Reserved :cool:

Please don't forget to click Installed, and if you use it, show us a link to your dropdown box ;)

Stromba
01-01-2009, 05:05 PM
well thank you verry much i love it :)

UKBusinessLive
01-01-2009, 05:47 PM
well thank you verry much i love it :)

Thank you Sir, Hope it works for you :D

lenzo
01-03-2009, 08:37 AM
Can you take this one step further and set up user defined links that you add to the drop down menu?

I tried getting someone to do this before with no luck (see the link below).

http://www.vbadvanced.com/forum/showthread.php?t=30095

I enclosed the same file, so you can try it out. If you can get it working properly, you can release it as a mod with my permission. I just need someone to take it to the next step. Anybody out there that can do it...

UKBusinessLive
01-03-2009, 09:19 AM
Can you take this one step further and set up user defined links that you add to the drop down menu?

I tried getting someone to do this before with no luck (see the link below).

http://www.vbadvanced.com/forum/showthread.php?t=30095

I enclosed the same file, so you can try it out. If you can get it working properly, you can release it as a mod with my permission. I just need someone to take it to the next step. Anybody out there that can do it...

I'll take a look for you lenzo, but i've not had much experiance with vbadvanced, bear with me :cool:

UKBusinessLive
01-04-2009, 02:21 PM
*****************************UPDATE*************** *******************
4th Jan 2009

Please find below an .xml file, This is the Menubox done within a Module for vBa

It's the actual module with the default url still in place. (You need to edit these - Unless you want a link to my site :D)
Anyone with vBa3 can upload it via the vBa control panel.
Lower versions of vBa may need to edit the .xml file.
REMEMBER you still need to upload the subnav.js file to your forum root

Many Thanks to Mal for this Code ;)

Enjoy :D
*****************************UPDATE*************** *******************

RedeemedWarrior
01-07-2009, 04:54 AM
excellent!

UKBusinessLive
01-07-2009, 05:07 AM
excellent!

Thanks:D

RedeemedWarrior
01-07-2009, 05:22 AM
anyway this could be used to allow multiple dropdowns?

like for several sections

blind-eddie
01-07-2009, 06:51 AM
Can you take this one step further and set up user defined links that you add to the drop down menu?

I tried getting someone to do this before with no luck (see the link below).

http://www.vbadvanced.com/forum/showthread.php?t=30095

I enclosed the same file, so you can try it out. If you can get it working properly, you can release it as a mod with my permission. I just need someone to take it to the next step. Anybody out there that can do it...


I have tried many time to do what you are trying to do, but I couldn't write a product for it.
So I made mine with manual edits. Works for me & you can easily easily add it as a vba template module. Try to get it to work with what you have, Good Luck

https://vborg.vbsupport.ru/showthread.php?t=185071




By the way, UKBusinessLive, Thank you for this add on, it will come in handy.

UKBusinessLive
01-07-2009, 04:07 PM
anyway this could be used to allow multiple dropdowns?

like for several sections

You can use it in as many forums as you want, You can create a quick link box at the top of each forum if you wanted to ;)

UKBusinessLive
01-07-2009, 04:07 PM
By the way, UKBusinessLive, Thank you for this add on, it will come in handy.

Your welcome :)

RedeemedWarrior
01-07-2009, 05:31 PM
You can use it in as many forums as you want, You can create a quick link box at the top of each forum if you wanted to ;)
really? when i tried it they appear to be working yet when you hit go it goes to only the first link on the first menu

UKBusinessLive
01-07-2009, 06:19 PM
really? when i tried it they appear to be working yet when you hit go it goes to only the first link on the first menu

Hi

Are you sure you have the correct Menu entries

select name="my_links" id="my_links">
<option value="http://www.ukbusinesslive.co.uk">UKBusinesslive Store</option>
<option value="http://www.ukbusinesslive.co.uk/topsite">Topsite</option>
<option value="http://www.google.com">Google</option>
<option value="http://www.ukbusinesslive.co.uk/links/">UKBL Links</option>



Just make sure you have them as shown or send them to me in a PM and i'll take a look for you, I'm not gonna rest tonight until your Sorted :D

:D

UKBusinessLive
01-12-2009, 07:04 PM
really? when i tried it they appear to be working yet when you hit go it goes to only the first link on the first menu

Did you manage to get it working?? RedeemedWarrior??

SpeedyHire
01-12-2009, 08:03 PM
shame it dont open in a new window, as it takes you waya from your forums
nice work still

UKBusinessLive
01-12-2009, 08:26 PM
shame it dont open in a new window, as it takes you waya from your forums
nice work still

Hi Speedy

There always a fix buddy, never give up :D

To get the link to open in a new browser window, what you do is add the target="_blank" attribute to your link tag, like this in your Menu Links area

<option value="http://www.ukbusinesslive.co.uk" target="_blank">UKBusinesslive Store</option>

If you do that to the ones that you want to open in a new window, then you don't navigate away from your site ;)

https://vborg.vbsupport.ru/external/2010/01/30.png

Enjoy :up:

TimberFloorAu
01-12-2009, 08:40 PM
could be worth for SEO reasons adding the attribute title

so

<option value="http://www.ukbusinesslive.co.uk" target="_blank" title="UkBusinessLive Online Store">UKBusinesslive Store</option>

UKBusinessLive
01-12-2009, 08:41 PM
Nice :D

:up::up::up:

shane greer
01-17-2009, 09:23 PM
I have tried to install it in a couple of different threads. See my forum.

www.thefewgoodmen.com/FGMForum

The links from the first drop down are replicating int he second drop down.

UKBusinessLive
01-17-2009, 09:49 PM
Hi Shane,

You seem to still show my discriprtions to my sites as in the demo in the second link menu, but as you say they are pointing to the 1st link menu items?? Are you making sure you've edited the Menu Links correctly ??

Not sure what else it could be, have you tried it in a different forum category to see if that works?? I can't really see a problem with it not working directly below anotherone, they are two seperate forums :confused:

shane greer
01-17-2009, 11:00 PM
I moved it to a different section completely and it still sends me to the links from the first drop down. :(

In the second links I added it as you had laid out with your pre-programmed links and they still changed to my links from my first drop down menu.

I have removed the second drop down until we can find a solution.

UKBusinessLive
01-18-2009, 08:39 AM
I moved it to a different section completely and it still sends me to the links from the first drop down. :(

In the second links I added it as you had laid out with your pre-programmed links and they still changed to my links from my first drop down menu.

I have removed the second drop down until we can find a solution.

Thanks shane, pehaps the javascript is getting confused with two examples running in the same page :confused:

Why don't you add some tabs to the top of your forum and add the extra content there??

https://vborg.vbsupport.ru/showthread.php?t=200686

;)

shane greer
01-18-2009, 09:12 AM
Ok thanks anyway.

rapidphim
02-18-2009, 03:22 PM
Instead of having all subforum listed, can we use this hack to drop down all subforum(s)?

UKBusinessLive
02-18-2009, 03:24 PM
Instead of having all subforum listed, can we use this hack to drop down all subforum(s)?

Sure :up:

rapidphim
02-18-2009, 03:33 PM
the process of doing that is the same as above instruction?

UKBusinessLive
02-18-2009, 03:53 PM
the process of doing that is the same as above instruction?

Sure just add your sub forums urls :D

simoncauchi
04-15-2009, 10:47 AM
Installed. Thankyou

down.low
04-19-2009, 12:20 AM
UKBL,.- another thing you can do is put them between an <li> tag on one of your blacktabs.

Noosphere
04-19-2009, 01:24 AM
To Open in new Browser Window

To get the link to open in a new browser window, what you do is add the target="_blank" attribute to your link tag, like this in your Menu Links area

<option value="http://www.ukbusinesslive.co.uk" target="_blank">UKBusinesslive Store</option>

If you do that to the ones that you want to open in a new window, then you don't navigate away from your site

I love this mod - but the above is not working for me. Even when I cut and paste exactly as you have it there, it does not open a new window. Can someone take a look at that and see if there is a tweak to make this work? I really need it to open a new browser window versus navigating away from my site.

Thanks in advance!

Noosphere
04-19-2009, 03:48 PM
Btw, in relation to the target="_blank" coding tweak not working for me (to have links open up in a new browser window), I am running vb 3.8.2 if it matters.

I'd also like to know if it's possible to have any of the links in the dropdown list show up as bolded or with colored text?

Noosphere
04-20-2009, 09:46 AM
Anyone with a suggestion out there?

TheLastSuperman
04-20-2009, 02:34 PM
Btw, in relation to the target="_blank" coding tweak not working for me (to have links open up in a new browser window), I am running vb 3.8.2 if it matters.

I'd also like to know if it's possible to have any of the links in the dropdown list show up as bolded or with colored text?

You can do that via the css (have not DL'd the mod but I assume it has a css file) OR by adding in <font> tags to specify color/bold/italic etc etc. I'll check on you later today after work as I'm enjoying lunch :p

Noosphere
04-22-2009, 02:59 AM
I am not familiar with the whole CSS thing...I haven't been able to get tags to work for color or bold fonts...doesn't seem like it should be hard, but so far no luck.

I'm really more interested in the code to have the link open up a new browser window when clicked. Anyone got suggestions on that?

Thanks in advance!

Noosphere
04-25-2009, 10:53 AM
Still looking for help with the code text to get the drop-down link to open a new browser window guys? I've inserted the target="_blank" text exactly as shown, and it doesn't work.

Anyone have suggestions?

UKBusinessLive
04-26-2009, 08:51 AM
Hi,

This is how it looks without the target blank

<option value="http://www.ukbusinesslive.co.uk">UKBusinesslive Store</option>

and this is where you add the target blank, to get the link to open into a new page, highligted in blue

<option value="http://www.ukbusinesslive.co.uk" target="_blank" >UKBusinesslive Store</option>

you need to make sure that its the same layout as above and that you have all the " in the right place. Theres no real reason for it not to work as its basic HTML

Let me know how you got on, or perhaps post your code here and we'll take a look

;)

Noosphere
05-02-2009, 03:10 PM
Hi,

This is how it looks without the target blank

<option value="http://www.ukbusinesslive.co.uk">UKBusinesslive Store</option>

and this is where you add the target blank, to get the link to open into a new page, highligted in blue

<option value="http://www.ukbusinesslive.co.uk" target="_blank" >UKBusinesslive Store</option>

you need to make sure that its the same layout as above and that you have all the " in the right place. Theres no real reason for it not to work as its basic HTML

Let me know how you got on, or perhaps post your code here and we'll take a look

;)

Unless I'm blind, that's how I have a couple of the links formatted. Here's the initial snippet of code showing one of the links setup as you've instructed (but it doesn't perform any differently than the other links when clicked by opening a new window):

<div id="drop_box_nav"><form action="#" onsubmit="return go_nav();"><select name="my_links" id="my_links" align="center">
<option value="http://www.dabearz.com/forums/" target="_blank" >Bears/DaBears</option>
<option value="http://www.chicagobears.com/">Bears/Team Site</option>
<option value="http://forums.bengalszone.com/">Bengals/BengalsZone</option>

Appreciate the help!

UKBusinessLive
05-02-2009, 04:12 PM
Hi

heres your code

<option value="http://www.dabearz.com/forums/" target="_blank">Bears/DaBears</option>
<option value="http://www.chicagobears.com/">Bears/Team Site</option>
<option value="http://forums.bengalszone.com/">Bengals/BengalsZone</option>

You'll see that there are some errors in your code, if you look at what you need to have shown below, i will highlight in red the errors in your code which you'll need to delete for your menu to open in a new window

So this is what it should look like

<option value="http://www.ukbusinesslive.co.uk" target="_blank" >UKBusinesslive Store</option>

and this is where you've gone wrong, highlighted in red

<div id="drop_box_nav"><form action="#" onsubmit="return go_nav();"><select name="my_links" id="my_links" align="center">
<option value="http://www.dabearz.com/forums/" target="_blank" >Bears/DaBears</option>
<option value="http://www.chicagobears.com/">Bears/Team Site</option>
<option value="http://forums.bengalszone.com/">Bengals/BengalsZone</option>

You seem to have a forward slash "/" at the end of your urls, Delete that and the target="_blank" should work ;)

Noosphere
05-02-2009, 08:50 PM
Hi

heres your code

<option value="http://www.dabearz.com/forums/" target="_blank">Bears/DaBears</option>
<option value="http://www.chicagobears.com/">Bears/Team Site</option>
<option value="http://forums.bengalszone.com/">Bengals/BengalsZone</option>

You'll see that there are some errors in your code, if you look at what you need to have shown below, i will highlight in red the errors in your code which you'll need to delete for your menu to open in a new window

So this is what it should look like

<option value="http://www.ukbusinesslive.co.uk" target="_blank" >UKBusinesslive Store</option>

and this is where you've gone wrong, highlighted in red

<div id="drop_box_nav"><form action="#" onsubmit="return go_nav();"><select name="my_links" id="my_links" align="center">
<option value="http://www.dabearz.com/forums/" target="_blank" >Bears/DaBears</option>
<option value="http://www.chicagobears.com/">Bears/Team Site</option>
<option value="http://forums.bengalszone.com/">Bengals/BengalsZone</option>

You seem to have a forward slash "/" at the end of your urls, Delete that and the target="_blank" should work ;)

Yeah, I'd thought of that and removed them. Tried it again just now. Same result. Mind-boggling...

Noosphere
05-07-2009, 06:50 PM
UK - any thoughts on why I'm still not able to get the links to open to a new browser window? Thanks in advance...

UKBusinessLive
05-07-2009, 08:48 PM
UK - any thoughts on why I'm still not able to get the links to open to a new browser window? Thanks in advance...

Hi Mate, I'm looking into this, seems strange, will post back here when i've done my testing ;)

Noosphere
05-08-2009, 11:38 PM
Hi Mate, I'm looking into this, seems strange, will post back here when i've done my testing ;)

The code supplied (to make a clicked url open in a new browser window) obviously works generally ....just not in this situation.

If it helps, I'm using this code in a 'BB Code' module on the CMPS homepage of my forum. For whatever reason, it isn't working.

RichieBoy67
05-31-2009, 02:10 PM
This is just what I need! Thanks--Installing it right now..

Rich
webdevoman

BGObsession
07-05-2009, 01:58 PM
UK - I've got 4 different modules set up on my CMPS page using your mod here - it's great, but the code snippet still isn't resulting in url's opening in a separate window. I know it should, but it doesn't. I thought maybe because I had them set up as 'bb modules' that this might be the issue, but even when I convert them to 'php modules', the result is the same, clicking on a url takes me away from my site, it does not open a new browser window.

Help :)

deadlySniper
07-05-2009, 02:02 PM
This is a very nice mod. Thank you!

BGObsession
07-05-2009, 02:40 PM
I need one of you javascript experts to help figure out how to get the urls to open in a new window in this mod! I've done some google-hunting, and found lots of info, but it's mind-boggling to someone not javascript savvy...

betts02
08-01-2009, 08:09 PM
i have installed as you posted,tried without the / at the end of the links but when any members tried to click the url it just reloads my forum page ?
any ides ?

Sunka
08-02-2009, 01:44 AM
Installed, but also NOT open link in new tab.
Tried with and without / in the end of link, but it is same...link open in same window.
I think that is something within javascript where should be fix that.

UKBusinessLive
08-03-2009, 02:36 PM
Installed, but also NOT open link in new tab.
Tried with and without / in the end of link, but it is same...link open in same window.
I think that is something within javascript where should be fix that.

There is a bit of a nightmare getting the link to open in a new window, its a javascript problem and i've tried all different methods of opening a new window using javascript but i can't seem to hit the nail on the head, so if one of you brilliant JS coders could take a look :o

betts02
08-04-2009, 07:38 PM
for some reason with or without the / when clicked it just re-freshes my page.nothing else.any help please ?

betts02
08-05-2009, 10:00 PM
anyone know why above is happening and it is not working for me ?

UKBusinessLive
08-05-2009, 11:38 PM
anyone know why above is happening and it is not working for me ?

Not heard of that one before, Are you sure you've installed it correctly?

betts02
08-06-2009, 06:34 PM
<a href="http://nextgenerationgamers.co.uk/forums/" target="_blank">http://nextgenerationgamers.co.uk/forums/</a>

as you can see i have it all set up mate,installed it as posted but nothing works.any help or advice would be great,click installed,etc when it works for me.

UKBusinessLive
08-07-2009, 04:59 AM
http://nextgenerationgamers.co.uk/forums/

as you can see i have it all set up mate,installed it as posted but nothing works.any help or advice would be great,click installed,etc when it works for me.

Did you copy the 1st code into a new file called subnav.js ?? and uploaded this to your forum root?? Or use the one in the zip file ;) ?

The problem you have is the HTML code part (the second code ) cannot see the javascript file in your forums root (subnav.js)

Nice forum by the way :up:

;)

betts02
08-07-2009, 07:23 AM
got it working,my fault.put it in wrong section in root.
anyway is it possible to have it so it shows links in alphabetical order without doing it yourself ?

UKBusinessLive
08-07-2009, 02:26 PM
got it working,my fault.put it in wrong section in root.
anyway is it possible to have it so it shows links in alphabetical order without doing it yourself ?

Glad you got it working :cool: Don't forget to to click installed ;)

You'll need to arrange them in alphabetical order yourself i'm afriad, shouldn't take long with cut and paste ;)

betts02
08-08-2009, 08:53 PM
cheers mate.
tagged
installed
nominated

dentopolis
08-08-2009, 09:59 PM
Hello,

Excuse me, What is the name of the template of example's picture at first page?

Thank you

realdx
09-17-2009, 11:50 AM
Anyway to implent the target_blank option in the vbadvanced module? I tried but with no results.. :( thanks!!

Alucard^
10-25-2009, 07:07 PM
Good man, installed... I love it.

The only problem that I have, is that doesn't open in a new browser window. And I am using this:

<div id="drop_box_nav">
<form action="#" onsubmit="return go_nav();">
<select name="my_links" id="my_links">
<option value="http://www.google.com" target="_blank">Google</option>
<option value="http://www.google.com" target="_blank">Google</option>
<option value="http://www.google.com" target="_blank">Google</option>
<option value="http://www.google.com" target="_blank">Google</option>
</select>
&nbsp;&nbsp;
<input type="submit" name="sub_nav" id="sub_nav" value="Go to URL" />
</form>
</div>
<script type="text/javascript" src="subnav.js"></script>

Cla75
05-28-2012, 11:16 AM
Hi guys, I need your help
I uploaded the file in the root ... subnav.js
I opened a new forum and I have included in the description field


<div id="drop_box_nav">
<form action="#" onsubmit="return go_nav();">
<select name="my_links" id="my_links">
<option value="http://www.GOOGLE.com" target="_blank">GOOGLE</option>
</select>
&nbsp;&nbsp;
<input type="submit" name="sub_nav" id="sub_nav" value="Go to URL" />
</form>
</div>
<script type="text/javascript" src="subnav.js"></script>


on index the dropdown menu is visible, I see all the sub-menus, but if you click on "Go to URL" reload the forum index

why? can anyone help me please?

thanks