PDA

View Full Version : How to open a link in same page/window


jrw422dx
10-31-2013, 09:07 PM
Is there a code that can be added when you insert a link on the page to keep it from opening in a new tab/window/page, but open that link in the same page?

Also is there a special code that will work to insert a media player that shows up on the page and when clicked will not take you to a new page/window/tab?

I have lyrics to songs in a thread with a link to the MP3 file but cant figure out how to put a player there that people can just click the play button. Obviously when you put in the link it opens a new tab making you have to toggle back to view the lyrics.

Jon

midnz
11-01-2013, 06:13 AM
Is there a code that can be added when you insert a link on the page to keep it from opening in a new tab/window/page, but open that link in the same page?

Jon

target="_top"

http://www.w3schools.com/tags/att_a_target.asp

ozzy47
11-01-2013, 10:13 AM
I think what he is looking for is, target="_self" not top.

midnz
11-01-2013, 10:27 AM
I've always used "top" after discovering that using "self" sometimes causes issues, like selecting a link within a sidebar opens the webpage within that sidebar rather than the full window/tab. Mind you, I haven't tested that since 3.6x.

ozzy47
11-01-2013, 10:34 AM
Yeah I don't believe that is a issue anymore, but thanks for your explanation on why you use it that way. :)

jrw422dx
11-01-2013, 10:51 AM
Would it safe to assume that I would need to have ALLOW HTML on for that to be able to work? I have tried adding it several different ways in the add a link box and no results. It just posts the whole code and I get a 404 error when I click it.

ozzy47
11-01-2013, 10:55 AM
Where exactly is the link shown, and what is the code you are using to show it?

jrw422dx
11-01-2013, 11:05 AM
Here is what I am trying to make work.

<a href="http://www.online-ministries.org/audio/walt-mills-only-the-blood.mp3" target="_top">

Pasting that into the "LINK" box with TEXT highlighted produces nothing.

Would rather have a player one could just click on to listen but cant figure that either.

I am running 4.2.2 and ALLOWED HTML in that particular forum

And if you would like to look at the page and what I am trying to do, its here http://www.online-ministries.org/forum/showthread.php?4295-Songs-that-Inspire

As you will see with all the links I have there, all will open in a new tab which makes viewing the lyrics useless unless you switch back to the parent page

ozzy47
11-01-2013, 11:18 AM
TBH I don't even think opening the player in the same page will do what you want, you would need to have it open as a popup like when you go to post attachments. Maybe this mod can get what you want,
https://vborg.vbsupport.ru/showthread.php?t=235934&highlight=popup

I would not allow HTML in the forums, that is generally a bad idea.

jrw422dx
11-01-2013, 11:29 AM
Thank You Chris I will give that a shot this evening..

Anyone else have an idea or know of another way?