Gossamer Forum
Home : Products : Links 2.0 : Customization :

Mod to include the option to view links without description?

Quote Reply
Mod to include the option to view links without description?
Has anyone modified Links to provide users with the option to view the links in brief form - just as a listing, without the descriptions? I am certain this is possible, but have not figured out how to do it, so before I try to reinvent the wheel... Smile

-Spode
Quote Reply
Re: Mod to include the option to view links without description? In reply to
You dont need a mod, just edit site_html.pl!
Quote Reply
Re: Mod to include the option to view links without description? In reply to
I don't understand. I know I can edit site_html.pl or a template file to have the category pages contain just the links. But I want to have 2 separate pages for each category - one with description and one without. The one with description would be the default, and I would add a link to the no-description pages in the top-of-page menus.

However, don't I need to edit nph-buil.cgi somehow to have the second versions of the pages built in the first place? Or am I missing something fundamental?

-Spode
Quote Reply
Re: Mod to include the option to view links without description? In reply to
I don't understand what could be a reason to have a page without description, if you already got one with description set as default. But if this is what you want to do, then I would suggest to install a second "Links" script and configure it to use your existing database, in 'site_html.pl' replace this:



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">new</sup></small>~; }
if ($rec{'isPopular'} eq "Yes") { $output .= qq~ <small><sup class="pop">pop</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;
}




with this:



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~ \n~; }
if ($rec{'isNew'} eq "Yes") { $output .= qq~ <small><sup class="new">new</sup></small>~; }
if ($rec{'isPopular'} eq "Yes") { $output .= qq~ <small><sup class="pop">pop</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;
}



this will do what you want. But still, I don't understand, why would you want to have links without description, it's difficult to navigate, and the users will not know where they go. Smile

Sincerely,

Pasha
http://find.virtualave.net

------------------
-[ It's just another night; good morning Webmasters! ]-
Quote Reply
Re: Mod to include the option to view links without description? In reply to
Not to mention, that with Links v2.0, this ability is already built in using the Detailed Pages option.