Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [pugdog] URL to subcategories

Quote Reply
Re: [pugdog] URL to subcategories In reply to
hello

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
Subject Author Views Date
Thread URL to subcategories ridesworld 2511 Jan 5, 2002, 11:56 AM
Thread Re: [ridesworld] URL to subcategories
pugdog 2368 Jan 5, 2002, 6:11 PM
Post Post deleted by ridesworld
ridesworld 2355 Jan 6, 2002, 7:29 AM
Post Re: [pugdog] URL to subcategories
ridesworld 2359 Jan 6, 2002, 7:33 AM