Gossamer Forum
Home : Products : Links 2.0 : Customization :

Changing link display - question

Quote Reply
Changing link display - question
 I noticed the links display in this format:

<UL>
<LI>Link
</UL>
<UL>
<LI>Link
</UL>

Is there an easy way to display links this way?...

<UL>
<LI>Link
<LI>Link
</UL>

This would make pages shorter and (I feel) easier to read. It's more of a Yahoo.com approach instead of a Snap.com approach.
Quote Reply
Re: Changing link display - question In reply to
I am using Links 2 and templates, without css. You didn't say what you were using... but maybe this will help.

I did it by modifying the link.html template and taking out the <ul> </ul> in there.
Then I added it into category.html into the links section like this.

<!-- Links in this category. -->
<%if links%>
<ul><%links%></ul>
<%endif%>
Quote Reply
Re: Changing link display - question In reply to
I'm using Links 2 without templates and CSS turned off. I'll give your fix a try. Thanks.
Quote Reply
Re: Changing link display - question In reply to
  jones,
First of all remove all the available opening and closing tags of <ul> in sub site_html_link

In sub site_html_category, make the following changes :


sub site_html_category {
# --------------------------------------------------------
# This rountine will build a page based for the current category.
# Insert the following variables in the appropriate place.
#
# $category : The list of subcategories.
# $links : The list of links in this category.
# $time : The current time.
# $date : The current date.
# $title_linked : A linked version of the title bar.
# $title : An unlinked version of the title bar.
# $total : The total number of links in this category.
# $grand_total : The total number of links.
# $category_name : The category name.
# $category_name_escaped : The category name URL escaped (used for the Add function)
# $category_clean : The category name with _ and / removed.
#
# The following will work assuming you haven't changed the order of the
# category database. If you have, or have added new fields, you can access
# any of the information by using $category{$category_name}[field_num] where
# field number is the number (indexed from 0) of the field you want. Otherwise
# you can just use the following:
#
# $description : Category Description
# $meta_name : Meta Description Tag
# $meta_keywords : Meta Keywords Tag
# $header : Custom Header
# $footer : Custom Footer
# $related : A <li> list of related categories.
#

my ($output);

$output = qq~
<$dtd>
<html>

<head>
<title>$site_title: $category_clean</title>
<meta name="description" content="$meta_name">
<meta name="keywords" content="$meta_keywords">
<$css>
</head>

<$site_body>

<p><strong class="title">$title_linked</strong></p>

<h1>$site_title: $category_clean</h1>

$site_menu

<p>$category_name_escaped</p>

~; if ($header) { $output .= qq~<h2>$header</h2>
~; }
if ($category) { $output .= qq~
<h2>Categories:</h2>
$category
~; }
if ($links) {$output .= qq~
<h2>Links:</h2>
<ul>$links</ul>
~; }
if ($related) {
$output .= qq~
<h2>Related Categories:</h2>
<ul>$related</ul>
~; }

if ($prev or $next) { $output .= qq~<p>~; }
if ($prev) { $output .= qq~<strong><a href="$prev">Prev $build_links_per_page</a></strong> ~; }
if ($next) { $output .= qq~<strong><a href="$next">Next $build_links_per_page</a></strong> ~; }
if ($prev or $next) { $output .= qq~</p>~; }

if ($footer) { $output .= qq~<p>$footer</p>~; }

$output .= qq~

$site_search
$site_footer

</body>
</html>
~;

return $output;
}


Haven't tried this myself yet, hope it works.
Regards.

----------------
Joe Thong
elara.hypermart.net

[This message has been edited by darkjoe (edited February 18, 1999).]