Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

How to modify the subcategory?

Quote Reply
How to modify the subcategory?
Hi all;
I have the script running very well. But I still need help in organizing the subcategory? Where will I go to change the <p> to the <br> for the subcategory listing?
Ex:
Subcategory1


Subcategory2

so I want to change it to:
Subcategory1
Subcategory2

no double space.
Please help me Alex and anyone?
Thanks.

------------------
Quote Reply
Re: How to modify the subcategory? In reply to
It is not the <p> that is causing that. It is the side effect of using <dl> (definition lists) for the categories. The <dl> tag (or its ending tag) will cause a blank line to be generated.

I don't know which version of links you are using but load up the appropriate site_html.pl or site_html_templates.pl and look in sub site_html_print_cat. Near the bottom of that routine, you will find something that looks like this:

Quote:
# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq~<dl><dt><strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> ~;
$output .= qq~<small><sup class="new">new</sup></small>~ if (&days_old($mod) < $db_new_cutoff);
$output .= qq~</dt>~;
$output .= qq~<dd><span class="descript">$description </span></dd>~ if (!($description =~ /^[\s\n]*$/));
$output .= qq~</dl>~;

}

This is the code that formats the category list. You can remove the <dl>, <dt>, and <dd> tags (along with their corresponding ending tags) and replace them with what you want.

I hope this helps.
Quote Reply
Re: How to modify the subcategory? In reply to
could u explaim what

<dl>, <dt>, and <dd> do to the script
Quote Reply
Re: How to modify the subcategory? In reply to
A definition list (<dl> ) is similar in nature to the unordered list (<ul> ) or ordered list (<ol> ). It, and its close tag, specify the starting and stopping point of the list.

Inside the <dl></dl> tags, you use two other tags, <dt> (definition term) and <dd> (definition list definition). Here is an example:

Code:
Term
This is the definition of the first term.
Term
This is the definition of the second term.

Note that neither <dt> nor <dd> have a closing tag and that <dd> will indent under the <dt>. If the definition is more than one line, the second line will line up with the indentation used for the first line.

That is how Links lists the categories. The <dt> is the category name, and the <dd> is used for descriptions, indented under the category name.

I hope this answers your question.

[This message has been edited by Bobsie (edited March 13, 1999).]