Gossamer Forum
Quote Reply
URL to subcategories

I want to create an URL to subcategories for display.

I want something like:


the only problem I have is a full string of ID of it's father, and it's grandfather ID etc.

is there a global that can solve this problem, and that eventually works with Full_Names ??
Quote Reply
Re: [ridesworld] URL to subcategories In reply to
I think I know what you are trying to do. But, this will require some sort of translation between the full_name and the category ID. Because of how Links works, it's probably better to assign the Category ID's to the Name and Fullname fields. Then, override the display variables to create new Linked names from the Name_Text and Full_Name_Text fields.

(Of course copy the info from FullName and Name into those fields first!!)

PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Post deleted by ridesworld In reply to
Quote Reply
Re: [pugdog] URL to subcategories In reply to

I found a global today, that is used for displaying editors in categories (see Utils.pm)

I try to hack the code, and now I have this:

sub load_parents {
# -------------------------------------------------------------------
# You call this tag by placing <%Links::Utils::lload_parents%> in your
# category.html template. It will then make available an <%parents%>
# tag that you can use in your template. For example:
# <%Links::Utils::load_parents%>
# <%if parents%>
# The following users are editors in this category: <%parents%>
# <%endif%>
my $tags = GT::Template->tags;
my $cat_id = $tags->{category_id};
my $cat_db = $DB->table('Category');
my $parents = $cat_db->parents($cat_id);
my $str = '(' . join (',', @$parents,$cat_id) . ')';
my $sth = $cat_db->select ( GT::SQL::Condition->new('ID', 'IN', \$str) );
return {} unless ($sth->rows);

# Make any formatting changes you need here.
my $output = '';
while (my $string = $sth->fetchrow_hashref) {
$output .= qq~$string->{ID}/~;
$output .= "";
return { parents => $output };

this works exactly what I need, but I need to set foreign_char to Yes, because netscape 4.7 can't handle spaces in URL's