Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Open links in new window, NOT using templates

Quote Reply
Open links in new window, NOT using templates
G'day all! I've looked and looked, but all the answers to this old question seem to involve templates, which I am not using. Suggestions on where to look would be appreciated. Thanks! Cristine

Quote Reply
Re: Open links in new window, NOT using templates In reply to
Codes for NON-templates have been posted before....here they are AGAIN...

Change the following codes:

Code:

<a href="$rec{'URL'}">$rec{'Title'}</a>


to the following:

Code:

<a href="$rec{'URL'}" target="newwin">$rec{'Title'}</a>


in the sub site_html_link routine in the site_html.pl file.

Simple matter of editing the HTML codes. Since it looks like you may not be knowledgeable about Perl, you might want to consider using templates, since they are WAY easier to edit than using the NON-TEMPLATE.

Regards,

Eliot Lee
Quote Reply
Re: Open links in new window, NOT using templates In reply to
Mine actually looks like this:
<a class="link" href="$build_detail_url/$rec{$db_key}$build_extension">$rec{'Title'}</a>~)

and when I changed it to this:
<a class="link" href="$build_detail_url/$rec{$db_key}$build_extension" target="newwin">$rec{'Title'}</a>~)

nothing new happened.

I skimmed (not searched) every post back to November and didn't find anything that worked any better for me. Yes, it took me days.


Quote Reply
Re: Open links in new window, NOT using templates In reply to
That is FOR detailed pages....

You should see codes like the following:

Code:

<a href="$db_cgi_url/jump.cgi?ID=$rec{'ID'}">$rec{'Title'}</a>


Add target="newwin" in the link codes I just posted.

Got it??

Regards,

Eliot Lee
Quote Reply
Re: Open links in new window, NOT using templates In reply to
That code is nowhere in my site_html.pl file.
Here is the entire section, just for reference.

##########################################################
## A Link ##
##########################################################

sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like. It's a little complex looking just because we have to
# check for blank entries..

my (%rec) = @_;

$build_detailed ?
($output = qq~<ul><li><a class="link" href="$build_detail_url/$rec{$db_key}$build_extension">$rec{'Title'}</a>~) :
($output = qq~<ul><li><a class="link" href="$build_jump_url?$db_key=$rec{$db_key}">$rec{'Title'}</a>~);

if ($rec{'Description'}) { $output .= qq~ <span class="descript">- $rec{'Description'}</span>\n~; }
if ($rec{'isNew'} eq "Yes") { $output .= qq~ <small><sup class="new"><font color="#ff0000">new</font></sup></small>~; }
if ($rec{'isPopular'} eq "Yes") { $output .= qq~ <small><sup class="pop"><font color="#0000ff">pop</font></sup></small>~; }

$output .= qq~ <small class="date">(Added: $rec{'Date'} Hits: $rec{'Hits'} Rating: $rec{'Rating'} Votes: $rec{'Votes'}) <a href="$build_rate_url?ID=$rec{'ID'}">Rate It</a></small>
</ul>
~;

return $output;
}

Quote Reply
Re: Open links in new window, NOT using templates In reply to
Uh...yea it is....

LOOK at the following:

Code:

<a class="link" href="$build_jump_url?$db_key=$rec{$db_key}">$rec{'Title'}</a>


PUT THE CODES I HAVE ALREADY RECOMMENDED IN THE LINK CODES!

I highly suggest you using TEMPLATES, since you definitely are having problems using
site_html.pl.

Regards,

Eliot Lee
Quote Reply
Re: Open links in new window, NOT using templates In reply to
Thank you for the clarification, what I had done was copy the line I was supposed to modify directly from your post and search for it in my text editor. now that they match, everything is runnung fine.

And this is the first trouble I've had with my site_html file.

Thanks,

Cristine

ps, be on the lookout for my next 'dumb' question.