Loans | Novela romantica | Mobile Phones | Remortgage | Montana Music
Automatically linking certain words [Archive] - PCMech Forums

PDA

View Full Version : Automatically linking certain words


fatboyjim
11-30-2004, 04:59 PM
This thought just popped into my head, excuse me if it's a bit weird/impossible

If you had a large website with pages of jargon that needed to be referenced back to a jargon buster/glossary page, what would be the easiest way of getting every occurence of a chosen word to link to that section of the glossary?

Can it be done with, I dunno style sheets or something?

:S
cheers
jim

mairving
11-30-2004, 05:21 PM
Stylesheets wouldn't help any. You could possibly use Javascript something like this site uses for the ad links. That can be a bit heavy on the browser sometimes if there are a lot of words on the page.

If your pages are in a database then, you could probably use regular expressions to change various words when they are entered into the database. In other words, you enter the word, fatboyjim and it converts that word to <a href="#" title="link to dictionary">fatboyjim</a>. That wouldn't be extremely difficult to do but would require some testing to work out some of the bad data.