Gossamer Forum
Quote Reply
Replace a word by a link
Hi,

Would it be possible with a global to replace a word by a link in description (or tag html) ?

Thanks!

Mick
Quote Reply
Re: [MJ_] Replace a word by a link In reply to
Hi,

You want to replace a word in the description with a link? You could try:

replace_with_link
Code:
sub {
my $string = $_[0];
$string =~ s|\bTHEWORD|<a href="#">THEWORD</a>|g;
return $string;
}

Then call with: <%replace_with_link($Description)%>

Untested, but should work =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Replace a word by a link In reply to
Hi Andy,

It is perfect for me! Smile

Thanks again!

Mick