Gossamer Forum
Home : Products : Links 2.0 : Customization :

Problem related categories

Quote Reply
Problem related categories
Because I don't see in the categories the Related Categories

thanks


http://lnx.nauticalink.it/links
- - - - - - - - - -- - - - - -
DirectoryNautica-Italia
http://www.nauticalink.it
Quote Reply
Re: [blecchi] Problem related categories In reply to
Do you have this in your template?

<!-- Related Categories -->
<%if related%>
<h2>Related Categories:</h2>
<ul><%related%></ul>
<%endif%>


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Problem related categories In reply to
Yes this my html

--------------------------------------

<head>
<title><%category_name%></title>

<!-- Subcategories-->
<%if category%>
<h2>Categorie:</h2>
<%category%>
<%endif%>

<!-- Links in this category. -->
<%if links%>
<h2>Links: </h2>
<%links%>
<%endif%>

<!-- Next/Previous links if spanning pages. -->
<p align=center>
<%if prev%>
<small><a href="<%prev%>">Indietro <%build_links_per_page%></a></small>
<%endif%>
<%if next%>
<small><a href="<%next%>">Avanti <%build_links_per_page%></a></small>
<%endif%>
</p>

<!-- Related Categories -->
<%if related%>
<h2>Related Categories:</h2>
<ul><%related%></ul>
<%endif%>


<p><strong class="title"> <%title_linked%> </strong></p>
- - - - - - - - - -- - - - - -
DirectoryNautica-Italia
http://www.nauticalink.it
Quote Reply
Re: [blecchi] Problem related categories In reply to
Did you enter Related Categories in the admin section?


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Problem related categories In reply to
thanks
- - - - - - - - - -- - - - - -
DirectoryNautica-Italia
http://www.nauticalink.it
Quote Reply
Re: [PerlFlunkie] Problem related categories In reply to
as I can have the relateds visualized categories in horizontal and not in vertical

vien http://lnx.nauticalink.it/...rtali_della_Nautica/

Thanks
- - - - - - - - - -- - - - - -
DirectoryNautica-Italia
http://www.nauticalink.it
Quote Reply
Re: [blecchi] Problem related categories In reply to
The code to change is in nph-build.cgi, in the sub_build_category_pages:

# Calculate the related entries and put in a <LI> list.
@related = split(/\Q$db_delim\E/, $related); $related = "";
foreach $relation (@related) {
$related .= qq|<li><a href="$build_root_url/|;
$related .= &urlencode($relation);
$related .= qq|/$build_index">|;
$related .= &build_clean($relation);
$related .= "</a></li>";
}

To make it a horizontal list, with commas, do this:

# Calculate the related entries and put in a <LI> list.
@related = split(/\Q$db_delim\E/, $related); $related = "";
foreach $relation (@related) {
$related .= qq|<a href="$build_root_url/|;
$related .= &urlencode($relation);
$related .= qq|/$build_index">|;
$related .= &build_clean($relation);
$related .= "</a>, ";
}

Then in your template, remove these:

<!-- Related Categories -->
<%if related%>
<h2>Related Categories:</h2>
<ul><%related%></ul>
<%endif%>


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Problem related categories In reply to
And possible to have the number of the present links appeared in the related categories also you see example http://www.boatdesign.net/...Sailboats_Multihull/

thanks
- - - - - - - - - -- - - - - -
DirectoryNautica-Italia
http://www.nauticalink.it
Quote Reply
Re: [blecchi] Problem related categories In reply to
Try this:

$related .= "</a>($numlinks) ";


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Problem related categories In reply to
I have done as you have pointed out to me but the number doesn't go out you see example http://lnx.nauticalink.it/...rtali_della_Nautica/

# Calculate the related entries and put in a <LI> list.
@related = split(/\Q$db_delim\E/, $related); $related = "";
foreach $relation (@related) {
$related .= qq|<a href="$build_root_url/|;
$related .= &urlencode($relation);
$related .= qq|/$build_index">|;
$related .= &build_clean($relation);
$related .= "</a>($numlinks) ";

thanks
- - - - - - - - - -- - - - - -
DirectoryNautica-Italia
http://www.nauticalink.it
Quote Reply
Re: [blecchi] Problem related categories In reply to
Found this:

http://www.gossamer-threads.com/...cgi?post=26637#26637

Do like so:

$related .= "</a>$stats{$relation}[0] ";




Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Jun 22, 2004, 4:10 PM
Quote Reply
Re: [PerlFlunkie] Problem related categories In reply to
because the number is visualized in this way 2 and not in this way correct piu' (2) you see example http://lnx.nauticalink.it/...rtali_della_Nautica/

thanks
- - - - - - - - - -- - - - - -
DirectoryNautica-Italia
http://www.nauticalink.it
Quote Reply
Re: [blecchi] Problem related categories In reply to
Did you try putting the parenthesis in the code?

$related .= "</a>($stats{$relation}[0]) ";


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Problem related categories In reply to
thanks
- - - - - - - - - -- - - - - -
DirectoryNautica-Italia
http://www.nauticalink.it
Quote Reply
Re: [blecchi] Problem related categories In reply to
You're welcome! Wink

Did you add each top-level category as a related category? I am wondering because your site shows this from the Motori Marini category page:

Motori Marini (0) Motori Marini : Benzina (1) Motori Marini : Diesel (1) Motori Marini : Entrobordo (1) Motori Marini : Fuoribordo (1)

Even though there are three links on the page, it shows a zero (0). In the admin, for category Motori Marini, did you enter Motori Marini as related? If yes, remove it, so your related cats will make more sense (and count right...).

Also remember that a related category does not have to be a subcategory, like Motori Marini : Diesel. It can be any category, like Directory from the world : Propulsion.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Problem related categories In reply to
I have modified in this way you see example http://lnx.nauticalink.it/...ortali_della_Nautica / there and another problem is not visualized the number of link

thanks
- - - - - - - - - -- - - - - -
DirectoryNautica-Italia
http://www.nauticalink.it
Quote Reply
Re: [blecchi] Problem related categories In reply to
In Reply To:
1 - I have modified in this way you see example http://lnx.nauticalink.it/...ortali_della_Nautica / there and another problem is not visualized the number of link 2 - as I can make to have all links in the right side of I screen it in a chart you see example http://www.boatdesign.net/Directory/Sailboats /

thanks
- - - - - - - - - -- - - - - -
DirectoryNautica-Italia
http://www.nauticalink.it