Gossamer Forum
Home : Products : Links 2.0 : Customization :

Description Problem

(Page 2 of 2)
> >
Quote Reply
Re: Description Problem In reply to
Glennu, only one slash is needed....

/g;

Eliot: Im pretty sure it is $in{'Description'};

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Description Problem In reply to
Only if the codes are being used in the ADD subs in the site_html_templates.pl file (e.g., sub site_html_add_form[/b]). If the codes are being used in the sub site_html_link as referenced a number of times in this Thread, THEN YOU need to USE the record hash of $rec NOT $in!

Regards,

Eliot Lee
Quote Reply
Re: Description Problem In reply to
Yes I know but webling said that he was referring to the link description, in which case the code needs to be added to add.cgi and so $in{'Description'} needs to be used.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Description Problem In reply to
Right...but he has referred to sub site_html_link routine, which again, the $rec{'Description'} codes must be used...

If it is within the add forms, then yes, as I stated you would use $in{'Description'}!

Regards,

Eliot Lee
Quote Reply
Re: Description Problem In reply to
I'm not disagreeing. I was just going by what he said near the top, that's all, so I assumed he wanted the code for add.cgi

No probs.

In Reply To:
I was refering to the Link Description not the Category description.
Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Description Problem In reply to
And I am operating under the assumption (since the user has not been clear from base 1) that he wants LINK DESCRIPTIONS within category and search result pages to show up in a wrapping manner, which you use the reg exp codes in the sub site_html_link routine.

Regards,

Eliot Lee
Quote Reply
Re: Description Problem In reply to
OK so we'll agree to agree to differ. Smile

Just ignore me, it's 12.45am in rainy Manchester, UK.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Description Problem In reply to
Sorry if this question has already been answered, but I think that this is what you want:

I use this code in site_html_templates.pl. It converts my existing descriptions to properly formatted html with line breaks without any need to mess with the database.


sub site_html_whatever {

my $proper_html = $rec{'Description'};
$proper_html =~ s/\n/<BR>\n/g;


my %rec = @_;
return &load_template ('pages.html', {

total => $total,
grand_total => $grand_total,
title_linked => $title_linked,
new_mod_img => $new_mod_img,
rate_img => $rate_img,
Hits => $Hits,
proper_html => $proper_html,
Votes => $Votes,
%rec,

%globals
});

Works in link.html or whatever you want, as everyone has said by using <%proper_html%> instead of <%Description%>. The bold bits are what you need to insert into the code in their corresponding positions.
Quote Reply
Re: Description Problem In reply to
Actually that isn't right......

$proper_html =~ s/\n/< BR >\n/g;

Why do you have a \n after the br tag?.....A br tag IS equivalent to a \n so you don't need both. Secondly the \n is useless as the page is HTML.

$proper_html =~ s/\n/< BR >/g;




Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

> >