Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Add a Resource - No drop down box for Categories

Quote Reply
Add a Resource - No drop down box for Categories
When I am on my main page of links2 directory, and I select "Add a Resource", I noticed there is no dropdown box for the Category area. I can fill out what I can, then submit, and I'll get an error on the next page (error page) as follows..

Error Adding Resource

There were the following errors trying to add your resource:

Category (Can not be left blank)

Please make any changes and try again!

Only then (on error page) will I see a category dropdown box where I can make a choice of what category I wish to place my resource in.

Any ideas on how to fix this? This does not happen when I try to "add a resource" elsewhere on my site, because the category or sub category is "filled in".

Thanks!



Quote Reply
Re: Add a Resource - No drop down box for Categories In reply to
Make sure that you have the following tag in the add.html file:

Code:

<%Category%>


Regards,

Eliot Lee Wink
http://anthrotech.com/
Quote Reply
Re: Add a Resource - No drop down box for Categories In reply to
Hello Eliot,

That was the first place I looked for, was the ASP <%Category%> tag on add.html It wasn't the problem, I thought maybe it was the add.cgi or something somewhere.. that was "messed" up. I uploaded a new add.cgi (755) from the fresh links2 zip file, still didn't fix the problem.

The <%Category%> tag worked fine everywhere, just not the main page.

Any other ideas?
Thanks for your quick response!

Quote Reply
Re: Add a Resource - No drop down box for Categories In reply to
In Reply To:
That was the first place I looked for, was the ASP <%Category%> tag on add.html
It isn't an asp tag :)

Mods:http://wiredon.net/gt/download.shtml
Installations:http://wiredon.net/gt/
Quote Reply
Re: Add a Resource - No drop down box for Categories In reply to
1) Do you have the following codes in your sub site_html_add_form routine in the site_html_templates.pl file:

Code:

sub site_html_add_form {
# --------------------------------------------------------
# This routine determines how the add form page will look like.
#
&html_print_headers;

my $category = shift;
$category ?
($category = qq~$category <input type=hidden name="Category" value="$category">~) :
($category = &build_select_field ("Category", "$in{'Category'}"));


print &load_template ('add.html', {
Category => $category,
%globals
});
}


2) Is the CATEGORY field in your links.def file called Category?

Regards,

Eliot Lee Wink
http://anthrotech.com/
Quote Reply
Re: Add a Resource - No drop down box for Categories In reply to
Mine's a bit different (shown below).. not sure why lol.. probably from some mod.. maybe you have an idea what it was?

sub site_html_add_form {
# --------------------------------------------------------
# This routine determines how the add form page will look like.
#
&html_print_headers;

my $incat = shift;

if ($db_single_category == 1){
my $c_clean = &build_clean($incat);
$category = qq~$category <input type=hidden name="Category" value="$incat">$c_clean~;
}
else {
$category = &build_select_field ("Category", "$in{'Category'}");
}

print &load_template ('add.html', {
Category => $category,
%globals
});
}

Anyway, I tried your code snippet, and everything works just fine now :)
Thank you Eliot!

Quote Reply
Re: Add a Resource - No drop down box for Categories In reply to
Paul,

I called it an ASP tag, because in Dreamweaver UltraDev 4, the <%Category%> code looks like a yellow [ASP] tag. I know I still have a lot to learn regarding perl, cgi, asp, etc but I'm having a great time learning ;)

Quote Reply
Re: Add a Resource - No drop down box for Categories In reply to
That would do it...modding does have a tendency to screw up codes...

BTW: You don't really need that conditional statement in the site_html_add_form...you need to simply specify 1 for the $db_single_category variable in the links.cfg file.

Regards,

Eliot Lee Wink
http://anthrotech.com/