Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Please HELP!! sub-links (mini links)

Quote Reply
Please HELP!! sub-links (mini links)
How do you make minilinks or sublinks under a category? for example you have Arts and Humanities category, there are small links at the bottom of it. Please help!
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
Please expand on what your saying, or give us a more detailed example.

------------------
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
Sounds like he's looking for something along the lines of Yahoo's main page. Under each category, you have short-cut links to some of the sub-categories underneath it.

I also thought this might be nice to incorporate, but I don't have an idea where to begin! I imagine it would require some pretty hefty modifying of the build code.

Dan
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
If thats what you want, you are able to use HTML in the category descriptions, so just inclue the HTML links to the files. I think therew is something in the FAQ about it. Im doin ghtat on my website, servers down for a bit so I cannot show you it.

------------------
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
Jimz,

Yeah, that would work if you weren't concernced about the sub-categories changing from time to time or new sub-cats being added. In either case, you would manually have to update your home template. I was trying to think of a way to automate the whole process. I.e., the home build knows the category pages and the category build knows the sub-category pages, so maybe the home build can also know the sub-category pages? Does that make any sense?

Dan
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
You dont have to manually update your home.html file, just change the code in the description of the category.

------------------
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
Hi Jimz & Dan

you got what i mean. The underneath subcategories shortcut links. I have tried it but it works. But i have one more problem on the alignment. It seems to be so far from the main category and its not exactly below it. It moved to the right. Please help. Anyways, Thanks in advance.
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
Jimz,

Is this the variable that will put sub-categories below the categories on the home.html page?

$subcategories{$cat}

From what I can tell, the categories (with their sub-cats) are built in nph-build.cgi, while home.html is built in site_html_templates.pl. This is where I was confused on having to manually update home.html if sub-cats change, but I suppose the two can be tied together. Do I have this completely wrong? My brain's moving kind of slow right now. Frown

Dan
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
Scratch that... I just corrected myself; the categories are build in site_html_templates.pl (and are already tied into nph-build.cgi). Now I see what I need to work with, so I'll try to stop being stupid! Wink

Dan
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
The category appearance on the home page is controlled by site_html_templates.pl. Look at the very bottom for the code. The categories are defined as a definition list (so it indents the description). If you take out the def list codes and add a break tag after the category name it should put the category right after the description. You also need to add extra breaks after the description to separate the categories with a space.
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
Ok, let us know what you come up with

------------------
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
I just followed brad Richardson's idea. I manually changed it, and it works! thanks Brad.
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
Brad Richardson wrote:"The category appearance on the home page is controlled by site_html_templates.pl. Look at the very bottom for the code. The categories are defined as a definition list (so it indents the description). If you take out the def list codes and add a break tag after the category name it should put the category right after the description. You also need to add extra breaks after the description to separate the categories with a space." I looked at that site_html_templates.pl file but I'm still not certain what to do. When you say "If you take out the def list codes..." what exactly do you mean? Reading someone elses script is difficult at the best of times and I'm afraid my knowledge of Perl is just so-so. If someone who has done this could cut and paste I'd be grateful.
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
For anyone that is interested, I have figured it out (after much hair pulling). Here is the bottom part of site_html_templates.pl. I hacked out everything that didn't seem to be necessary. Check out www.2ants.com to see how it looks. I think it looks pretty good.

# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).
if ($i == $half) {
$output .= qq|</td><td class="catlist" valign="top">\n|;
}
$i++;

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<strong><a class="link" href="$url">$category_name</a></strong><br>|;
$output .= qq|<span class="descript">$description </span><br><br>| if (!($description =~ /^[\s\n]*$/));

}

# Don't forget to end the unordered list..
$output .= "</td></tr></table></div>\n";
return $output;
}

1;
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
hi looser,

i just tryed your code! but i only see the main categories, do i have to change something else in the code?

thanks in advance
feigl
Quote Reply
Re: Please HELP!! sub-links (mini links) In reply to
That's all I changed. You put something like <a href="http://www.2ants.com/pages/Computers_&_Internet/Hardware/index.html">Hardware</a>, <a href="http://www.2ants.com/pages/Computers_&_Internet/Software/index.html">Software</a>, <a href="http://www.2ants.com/pages/Computers_&_Internet/Internet/index.html">Internet</a>...
in for the descriptions to your categories right?