Gossamer Forum
Home : Products : Links 2.0 : Customization :

link display

Quote Reply
link display
Is there a way to change the way my links are displayed depending on the category they are in. ie) if I have a category for flowers I do not want the "hits" or "rate it" fields displayed but in my recipe categories I want those fields to be visible in the links output.


Quote Reply
Re: link display In reply to
If you are using Links v2 with templates, it is easy to do.

Create a template file that you want to call flowers.html (or something like that). Then, copy everything that is in link.html to it except for the parts you do not want to display.

The go to sub site_html_link in site_html_templates.pl and add the following after my %rec = @_;:

Code:
my $template_name;

if ($rec{'Category'} =~ "Flowers") {
$template_name = "flowers.html";
}
else { $template_name = "link.html"; }

Then change:

Quote:
return &load_template ('link.html', {

to read:

Quote:
return &load_template ($template_name, {

If you are not using templates with Links v2 or are using Links v1, you can do a similar thing in site_html.pl itself using if/else statements when creating how a link looks.

I hope this helps.

[This message has been edited by Bobsie (edited March 06, 1999).]
Quote Reply
Re: link display In reply to
Thanks Bobsie that did the trick!