Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

HTML question re Opening link in new window.

Options
  • 07-05-2010 3:25pm
    #1
    Registered Users Posts: 3,395 ✭✭✭


    If it's possible, I want to include information on the Facebook/Profile/Website info box NOT as a bare link e.g. http://www.google.ie/, but as a name that will take the viewer to the link on a new page.

    I want to be able to take people from my Facebook Personal Profile page to my Facebook Business Page. But, I can't get it to work. Instead of the word appearing in the box, the entire HTML text appears. Maybe Facebook doesn'l allow this.

    Anyway, just to check that I'm doing it right.........

    I'm using Google as an example below. Have I configured it correctly? i.e. with the link in the first half of the HTML line and the word (in this case Google) between the two >< in the second half?


    <a href="http://www.google.ie/&quot; target="_blank">Google</a>

    Thanks.

    D.

    ps. When I post the thread, the work Google doesn't appear. The entire HTML text does, so same problem here. What am I doing wrong? Ta.


Comments

  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    Dinarius wrote: »
    If it's possible, I want to include information on the Facebook/Profile/Website info box NOT as a bare link e.g. http://www.google.ie/, but as a name that will take the viewer to the link on a new page.

    I want to be able to take people from my Facebook Personal Profile page to my Facebook Business Page. But, I can't get it to work. Instead of the word appearing in the box, the entire HTML text appears. Maybe Facebook doesn'l allow this.

    Anyway, just to check that I'm doing it right.........

    I'm using Google as an example below. Have I configured it correctly? i.e. with the link in the first half of the HTML line and the word (in this case Google) between the two >< in the second half?


    <a href="http://www.google.ie/&quot; target="_blank">Google</a>

    Thanks.

    D.

    ps. When I post the thread, the work Google doesn't appear. The entire HTML text does, so same problem here. What am I doing wrong? Ta.

    Some WYSIWYG editors will replace the angle-brackets with the HTML code equivalents, thinking that you DO want them to appear.

    View the source on the Facebook page and see if they have been converted to > and <


  • Registered Users Posts: 3,395 ✭✭✭Dinarius


    Liam,

    Thanks for the reply. I suspect the problem is with me.

    Why doesn't my Google HTML just appear as the word Google and not the full line of HTML?

    As to Facebook. If I paste in, for example, the Google HTML text above, this is how it reads in the Website link box after saving:

    http://<a
    http://href="http//www.google.ie/&quot;
    http://target="_blank">Google</a&gt;

    Weird!

    D.


  • Moderators, Business & Finance Moderators, Computer Games Moderators Posts: 10,462 Mod ✭✭✭✭Axwell


    The code you have above is correct

    <a href="http://www.google.ie/&quot; target="_blank">Google</a>

    The issue is with Facebook. When you put in a url into a message or post in facebook it automatically goes and finds the site and puts the full url underneath in the post. You will see if you try post the code above into a post on facebook the link box will appear underneath it and changes it.


  • Registered Users Posts: 3,395 ✭✭✭Dinarius


    Axwell,

    Thanks. That's that then.

    I'd still like to know why my line of HTML doesn't appear as the just the 'Google' on this thread?

    D.


  • Moderators, Business & Finance Moderators, Computer Games Moderators Posts: 10,462 Mod ✭✭✭✭Axwell


    I think its just because the editor here you type your posts in doesnt recognise the html like that and convert it. If you type a full url it will convert it to a link in the same way facebook does.

    You can do it manually highlighting the word and making it a hyperlink if you wanted using the editor on here when writing your post.

    Google

    Your code above is correct though if you try it in notepad and make a dummy webpage or anything, or if you were using it on a site that would be the correct code.


  • Advertisement
  • Closed Accounts Posts: 32 Antrim Hotels


    w3schools is a great website that has good information on html, xhtml, xml and much more. you should give it a try


  • Registered Users Posts: 3,395 ✭✭✭Dinarius


    I did this using the Boards.ie method.........

    Google

    .....but, I don't understand what I must do with my original HTML text to make it appear the same way? What do you mean by "highlighting the word"?

    I looked at the source text of this page and my line of text in your reply appeared to be unchanged.

    Sorry for being thick, but I'm just trying to learn something! :)

    Thanks.

    D.


  • Moderators, Business & Finance Moderators, Computer Games Moderators Posts: 10,462 Mod ✭✭✭✭Axwell


    Its like Liam said above, if you look at the souce code of my reply to you the code has changed and become

    <a href="http://www.google.ie/" target="_blank">Google<

    If you do it by highlighting the word on here and making it a hyperlink using the link icon in the editor the code doesnt get changed which is why it works in the other post. When I say highlighting the word I mean what you did in the last post to make the word Google the active link.

    Your code is right but its the forum changing the format that is causing the issue. If you open notepad and save a file with the following as test.html you will see your code is right and works.
    <head>
    </head>
    <body>
    <a href="[URL]http://www.google.ie/[/URL]" target="_blank">Google</a>
    </body>
    </html>
    


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    Dinarius wrote: »
    I did this using the Boards.ie method.........

    Google

    The boards.ie method is Bulletin Board Markup, not HTML.
    Dinarius wrote: »
    .....but, I don't understand what I must do with my original HTML text to make it appear the same way?

    OK - let's explain it this way.

    What you want to achieve is to leave the <> tags as HTML tags (which don't appear on a web page) , and there's nothing wrong with that.

    Unfortunately for you, some people will want to use "<" and ">" as less-than or greater-than symbols within the text.

    Because there are 2 "interpretations", a website editor has to choose either (a) which you want, or (b) which others might want

    Unfortunately (for your requirements), as I said, most online editors will default to (b)

    What Axwell is getting at is that some online editors will allow you to select (highlight) the text the same as you would in Word, and then click a "link" icon in a toolbar (usually looks like a sideways "8" - i.e. a "chain-link" icon) and type in the URL, so that it offers you a method of creating the code for (a) while still leaving people type the normal greater-than / less-than symbols.

    Even within website editing packages, it should automatically - and unbeknowns to you - convert an "in-text" "<" to < - the actual "<" character will always be interpreted as a HTML tag, and will probably hide any text that follows it, until the browser comes across a ">".


  • Registered Users Posts: 3,395 ✭✭✭Dinarius


    Ok. Got it.

    I pasted my line of HTML into the link box and got 2 Googles. I removed one of them and was left with what I wanted originally. Phew!

    The line of code changed from:

    <a href="http://www.google.ie/&quot; target="_blank">Google</a>

    to......

    URL="http://www.google.ie/"]Google[/URL but with [] at each end.

    Google

    I think(!) I've learned something!

    Thanks.

    D.


  • Advertisement
Advertisement