I've seen loads of posts from people having trouble with Jerry's mod or not being able to find one so I wrote one :)
It is really short and simple, requires no extra fields or messing about.
You will need to add two new options into links.cfg....
$max_subs = X; # Number of subcategories to show on main page
$hyperlink = 1; # 1 to hyperlink subcats or 0 for text
Then all you need to do is open up site_html_templates.pl and in site_html_print_cat replace:
$output .= qq|</dt>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
With:
$output .= qq|<br><small>| . qq| | x 4;
for (@{$subcategories{$subcat}}) {
if (m,^\Q$subcat\E/([^/]+)$,) {
$child = &build_clean($1);
if ($hyperlink) {
$output .= qq|<a href="$build_root_url/$subcat/$child/">$child</a>,|
}
else {
$output .= qq|$child,|
}
$j++;
if ($j == $max_subs) {
last;
$j = 0;
}
}
$j = 0;
}
chop $output;
$output .= qq|</small><br>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
Thanks :)
It is really short and simple, requires no extra fields or messing about.
You will need to add two new options into links.cfg....
$max_subs = X; # Number of subcategories to show on main page
$hyperlink = 1; # 1 to hyperlink subcats or 0 for text
Then all you need to do is open up site_html_templates.pl and in site_html_print_cat replace:
$output .= qq|</dt>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
With:
Code:
$output .= qq|</dt>|; $output .= qq|<br><small>| . qq| | x 4;
for (@{$subcategories{$subcat}}) {
if (m,^\Q$subcat\E/([^/]+)$,) {
$child = &build_clean($1);
if ($hyperlink) {
$output .= qq|<a href="$build_root_url/$subcat/$child/">$child</a>,|
}
else {
$output .= qq|$child,|
}
$j++;
if ($j == $max_subs) {
last;
$j = 0;
}
}
$j = 0;
}
chop $output;
$output .= qq|</small><br>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
Thanks :)