Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Category description template code.

Quote Reply
Category description template code.
Is there any <%template_code%> that can be used in category.html to display the categories description?

I want to start off each category with a description of what can be found in that category. I plan on eventually hacking around a bit, and adding a "summary information" field which would contain a more in depth description for these pages, but at the moment I'm just trying to get things up. =)


--
Mark Waterous mark@projectlinux.org
Project Linux - www.projectlinux.org/


[This message has been edited by Synesthesia (edited August 17, 1999).]
Quote Reply
Re: Category description template code. In reply to
Dang... that's a good question! <G> And it should be pretty easy... in theory.

I tried to see if I could do it, but I can't figure out where the variables are actually passed... The category stuff seems to be a bit less flexible than the links stuff.

nph_build.cgi constructs something it sends to &site_html_category but I can't figure out where in the chain to pass the value of Category.Description -- or where I'm holding the current category.description value, vs the subcategory description.

I think I'm trying to do too much too late at night ...
Quote Reply
Re: Category description template code. In reply to
You and me both. Does anybody mind if I rant about how much I dislike UBB for awhile? =P I think it's all I'm capable of right now till I get sleep.

I'll take a peek inside tomorrow. If it's not simple, it's better I just get it all over and done with now. If everything works, I'll post the mods here if anybody wants them.


------------------
Mark Waterous mark@projectlinux.org
Project Linux - www.projectlinux.org/

Quote Reply
Re: Category description template code. In reply to
When I designed the fields I intended the Description field to be used on a listing of categories, not in the actual category. This probably explains why it's not available as a <%description%> tag in the category.html. =)

Couple options:

1. Use the <%header%> tag. You can insert your html in the header field for each category, then just place <%header%> wherever you want it to be displayed.

2. Add:

$OUT{description} = $category_r->{'Description'};

Edited the above, should be a capital D in description. Make the change in line 392 in nph-build.cgi right after:

# Get the category info.

Cheers,

Alex

[This message has been edited by Alex (edited August 18, 1999).]
Quote Reply
Re: Category description template code. In reply to
Code:

$OUT{description} = $category_r->{'description'};
in line 392 in nph-build.cgi right after:
# Get the category info.

I knew there had to be a way<G> I just didn't think of that one <G>
Quote Reply
Re: Category description template code. In reply to
Thenkya Alex. =)

That makes one thing this morning very easy. Now to go try and convert some of the links 2.0 mods to links SQL mods. <g>
Quote Reply
Re: Category description template code. In reply to
Btw, along the line of this thread, is there an easy way to grab the total number of links for the particular category being accessed?

Not for that category and all it's sub categories, just the one category and use it in the template. (actually which might help with making a span pages mod for links SQL now that I think of it.. $numlinks / $LINKS{build_links_per_page} yadda yadda...)


------------------
Mark Waterous mark@projectlinux.org
Project Linux - www.projectlinux.org/

Quote Reply
Re: Category description template code. In reply to
 
Quote:
Btw, along the line of this thread, is there an easy way to grab the total number of links for the particular category being accessed?

Should be available in <%total%> tag.

Cheers,

Alex