Gossamer Forum
Home : Products : Links 2.0 : Customization :

little question

Quote Reply
little question
hi there, i searched the forums but didn't find my answer.

Is it posible to display my categories in this way
.:: category 1
.:: category 2
.:: category 3
.:: category 4

instead of
category 1 category 2
category 3 category 4
so i could add the category's in my menu table

Regards Dennis

Quote Reply
Re: little question In reply to
There is a Mod in the Resources section that allows you to have a "vertical" listing of categories.

Regards,

Eliot Lee
Quote Reply
Re: little question In reply to
I am looking for this hack..........
-----------------------------------
i want to display the catagory and sub catagoy any where or ant style i like.I think we need catagory variable and sub catagory variable. So we can insert any where in the html code.

thanks
netmastan

Quote Reply
Re: little question In reply to
mmm AnthroRules, i only see somthing for horizontal categories
maybe you could give me the name of the mod?
i searched in the resources center for vertical but didn't get what i was searching

Quote Reply
Re: little question In reply to
hi, If you have time, i think the way i do is ok.No need edit any cgi.You can display category as you wish.
Have a look my site
http://netmastan.hypermart.net/links/

*This is not full functional, when i get time i work and still need to config. I am trying to do like download.com style.*
----------------------------------------------------------
Ok,if you interested u can follow the bellow instruction.Ignor me if u are expert.

If must know html or any web designing program like dreamweaver or frontpage 2000.

1.Design your page(Don't think about anything).Just design your page,where and how you would like to display your catagory and sub category etc... now save this page as a home.html somewhere.
2.Open the template home.html from links2. See the source code.Try to understand the basic code,like for add a site the like is <%db_cgi_url%>/add.cgi etc.. you add this link for a new site in home.html(the one that you designed).You do the same thing for what's new link .Do others things etc....

3.Now go to admin section in the website.Add category and subcategory ,it has to be the same name that you used in ur own home.html page.
Do Staggered (Auto)in the building section(Admin Option).
so it will create category and sub category.................
4.Now open the home html(the one you created) and put the links for category and sub category according to the right location.(You created in the admin section).

5.Now upload this home.html to the template section.

I don't know if you understood my english.

Sorry man.English is not my first language.....

netmastan




Quote Reply
Re: little question In reply to
thx netmastan.

I could do that but then i have to modify the 22 templates files each time i add , delete or modify a category
I just wanted to do this (making the category's vertical so that i could at then in my menu table
and use the other space on the page for site info etc so that the page will not be to long.
But i think i have found sonthing here on the forum
wath does wath i want (only the subcategory's are displayed to vertical )
but i'll try to fix somthing so that it will not add the subcategory's in the menu
If u wanna see wath i mean go to here
http://www.gossamer-threads.com/perl/forum/showthreaded.pl?Cat=&Board=L2Cust&Number=122627&page=&view=&sb=&vc=1#Post122627

Greetz Dennis

btw sorry for my english to, first language is dutch, second english
Quote Reply
Re: little question In reply to
my sub routine isn't the same like the sub routine on the url above
so i can't change it
this is my sub routine , could somoene tell me wath to change?

sub site_html_print_cat {
# --------------------------------------------------------
# This routine determines how the list of categories will look.
# We now use a table to split the category name up into two columns.
# For each category you can use the following variables:
#
# $url : The URL to go to that category
# $category_name : The category name with _ and / removed.
# $category_descriptions{$subcat}: The category description (if any).
# $numlinks : The number of links inside that category (and subcategories).
# $mod : The newest link inside of that category.
#

my (@subcat) = @_;
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
my ($half) = int (($#subcat+2) / 2);

# Print Header.
$output = qq|<div class="margin"><table width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td class="catlist" valign="top">\n|;

foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];

# First let's get the name, number of links, and last modified date...
$url = "$build_root_url/" . &urlencode($subcat) . "/";
if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
$numlinks = $stats{"$subcat"}[0];
$mod = $stats{"$subcat"}[1];

# 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|<dl><dt><strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
my $days_old = &days_old($mod);
if ($days_old <= 2) { $output .= qq| $new_1|; }
elsif ($days_old <= 7) { $output .= qq| $new_3|; }
elsif ($days_old <= 14) { $output .= qq| $new_7|; }
$output .= qq|</dt>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl>|;
}

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

1;

Regard Dennis

Quote Reply
Re: little question In reply to
Quickest way is to go into site_html_templates. Find the sub print cat and delete the following:


# 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|;
}



Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: little question In reply to
Thx glennu
i'am gonna try it

Regards Dennis