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

Is it possible to aut-send category names add?

Quote Reply
Is it possible to aut-send category names add?
If I click on "Add URL" from within Category1/Category2, is there any way to have the Category field already filled out with this category name, instead of showing the category scroll bar? I am thinking I would just have to pass <%Category_ID%> along with add.cgi or something.

Quote Reply
Re: Is it possible to aut-send category names add? In reply to
By default...add.cgi will only build the select list if the CategoryID is not found...like from the home page. But if you have to configure the following variable:

Code:

$LINKS{db_gen_category_list} = 1;


in the Links.pm in order for this to work.

Look at the following codes in the add.cgi file:

Code:

# 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 ();
}
&site_html_add_form ({ Category => $category, %in }, $dynamic)
}


Translation:

1) If there is NO ID and you have "turned on" (1) the $LINKS{db_gen_category_list}, then send an error message to the user stating that they have to select a category before adding a link.

2) If there is an hidden print the Category name and hidden field for the CategoryID field.

3) If $LINKS{db_gen_category_list}) is turned off and if a Category ID is not found, then print the drop-down menu of the Categories for the CategoryID field.

Regards,

Eliot

Quote Reply
Re: Is it possible to aut-send category names add? In reply to
Eliot,

Thanks, but I have $LINKS{db_gen_category_list} set to 1. Still, no matter where I enter add.cgi from, the list is built. Any idea what might be wrong? What would setting it to 0 accomplish/do?

Thanks!

Quote Reply
Re: Is it possible to aut-send category names add? In reply to
0 (opposite of 1) = turns off

So, by turning the variable off, then the drop-down menu will appear no matter if you access the add.cgi from your home page or category pages.

Regards,

Eliot

Quote Reply
Re: Is it possible to aut-send category names add? In reply to
That's what I figured. But now, set at 1, how come I get a listing of categories no matter what?