PDA

View Full Version : Have vBulletin not open a new window when links are clicked


benzwm02
11-29-2012, 02:08 PM
Does anyone know how to edit vbulletin 5 so when links are clicked they do not open a new browser page?

In Omnibus
11-29-2012, 02:33 PM
Are you wanting the links to open in the same window or are you wanting the links not to open?

Simon Lloyd
11-29-2012, 02:33 PM
Change the link property in the css (i think) and add target="_parent" or "_self"

benzwm02
11-29-2012, 05:02 PM
Are you wanting the links to open in the same window or are you wanting the links not to open?

The links to open in the same window, not to open a new browser page.

--------------- Added 1354212204 at 1354212204 ---------------

Change the link property in the css (i think) and add target="_parent" or "_self"

Could you or someone show me specifically where? I am not a coder

Lynne
11-29-2012, 05:22 PM
You cannot do it via CSS (unless this is something I have never heard of). You could use javascript to make all external links open in the same window (google it - "javascript external link same window"), I believe.

Simon Lloyd
11-29-2012, 05:30 PM
lol didnt even realise i'd typed css - forget i spoke :)

--------------- Added 1354214100 at 1354214100 ---------------

It might sound daft but try this https://vborg.vbsupport.ru/showthread.php?t=239918 the code in it is simple, it's a plugin to replace target="_blank" so links open in the same window, if you cant import the product just copy the plugin code and create your own with the same hook.

nhawk
11-29-2012, 06:05 PM
lol didnt even realise i'd typed css - forget i spoke :)

--------------- Added 1354214100 at 1354214100 ---------------

It might sound daft but try this https://vborg.vbsupport.ru/showthread.php?t=239918 the code in it is simple, it's a plugin to replace target="_blank" so links open in the same window, if you cant import the product just copy the plugin code and create your own with the same hook.

You do realize that most, if not all of the hooks are gone in vB5? And that those that do exist don't work the same as vB4 hooks.

Simon Lloyd
11-29-2012, 06:52 PM
You do realize that most, if not all of the hooks are gone in vB5? And that those that do exist don't work the same as vB4 hooks.No i didnt, i dont have vb5, all the same the plugin code will work it's just a matter of finding the right trigger for parsed bbcode/links

benzwm02
11-30-2012, 02:15 AM
No i didnt, i dont have vb5, all the same the plugin code will work it's just a matter of finding the right trigger for parsed bbcode/links

I went to that link and imported it as a product. However, it did not work.

How do I make it make it into a product that will?

--------------- Added 1354245534 at 1354245534 ---------------

You cannot do it via CSS (unless this is something I have never heard of). You could use javascript to make all external links open in the same window (google it - "javascript external link same window"), I believe.

Do you mean something like this:

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

--------------- Added 1354245738 at 1354245738 ---------------

You cannot do it via CSS (unless this is something I have never heard of). You could use javascript to make all external links open in the same window (google it - "javascript external link same window"), I believe.

Do you mean something like this:

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

Lynne
11-30-2012, 02:30 AM
Yes, I mean something like what is in that mod thread. However, it is for vB4, so you'll have to just add it to your template in vb5 if you don't know how to upgrade a vb4 mod to vb5.

benzwm02
11-30-2012, 03:46 PM
Yes, I mean something like what is in that mod thread. However, it is for vB4, so you'll have to just add it to your template in vb5 if you don't know how to upgrade a vb4 mod to vb5.

Which template should I add it to? There is no headinclude in bulletin 5.

Lynne
11-30-2012, 04:21 PM
You can still use the same method to figure out the template. To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. (Sometimes the template is the one mentioned at the very top of the page source.)

benzwm02
11-30-2012, 05:24 PM
You can still use the same method to figure out the template. To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. (Sometimes the template is the one mentioned at the very top of the page source.)

I clicked yes to add template name in html. I am not sure if I did the rest of the steps correctly. What page am I going back to view the source code for? I searched for headinclude again but could not find anything. Can I just add that javascript somewhere in the head template?

Lynne
11-30-2012, 07:04 PM
Well, the <head> section is in the header template. Isn't that where you want to add the javascript?