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

Is This Possible?

Quote Reply
Is This Possible?
I am passing the category ID throughout my site for easier Add URL entry. However, I also hav people who would find it much easier to have the entire category list to choose from when entering links.

The algorithm would be as follows:

if (add.cgi called with cat id)
{display only that category}

else if (add.cgi called without cat id)
{display add url form with all categories in the pulldown}

any ideas?

Quote Reply
Re: Is This Possible? In reply to
Those codes are already in place...Look at the following codes in the sub main routine in the add.cgi file:

Code:

else {
my ($name, $category);
my $id = $in->param('ID');

# If we don't have an id, and can't generate a list, let's send the user a message.
if (! $id and ! $LINKS{db_gen_category_list}) {
&site_html_error ( { error => "Please go to the category you want to add to, and click add from there." }, $dynamic);
}
else {
if ($id) {
$name = &get_category_name ($id);
$category = "$name <input type=hidden name='CategoryID' value='$id'>";
}
else {
$category = &get_category_list ();
}
my $title_linked = &build_linked_cgi_title ("Add Link");
&site_html_add_form ({ Category => $category, %in, title_linked => $title_linked}, $dynamic)
}
}


What you would need to do is add another link without the CategoryID parameter, like the following:

Code:

<a href="<%db_cgi_url%>/add.cgi">Add Site</a>


You could put this link in any of your template files. The better thing to do is use a different header file for your template files than the one called category.html that includes the above link. Then in your category.html file, add the following link:

Code:

<a href="<%db_cgi_url%>/add.cgi?CategoryID=<%CategoryID%>">Add Site</a>


Hope this makes sense.

Regards,

Eliot Lee