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

Passing category number

Quote Reply
Passing category number
Hi,

I have:

add.cgi?<%category_id%> to add to the current category, and works fine.

In the add template, I want a "If you want to add details, click here (add.cgi?detailed=1&<%category_id%> )

The problem is, that <%category_id%> is not recognized as a tag from the add template.

How can I pass this tag, and have the option to "add detailed in the current category"

Thanks,
Emilio
Quote Reply
Re: Passing category number In reply to
In add.cgi you need to add a line:

my $category_id = $in->param('ID');

Then at the top where it makes the call:

&site_html_add_form ({ Category => $category, %in }, $dynamic)

you want to add:

&site_html_add_form ({ category_id => $category_id, Category => $category, %in }, $dynamic)

That should make the "ID" available in the add form.

Let me know if it works... It may need a bit of tweaking.

Quote Reply
Re: Passing category number In reply to
Hi,

I got a

/cgi-bin/add.cgi aborted due to compilation errors.

Quote Reply
Re: Passing category number In reply to
Check the server error logs! they will tell you why the program aborted!

It's virtually impossible to try to fix things if you don't have the error messages from the log. Sometimes, it's a real problem, other times it's a misplaced comma or } or ) or missing ;

As I said, the code may need tweaking... but that's the idea. It's how additional variables are passed.

If you look at the various calls in nph-build, search.cgi and add.cgi you'll get an idea of how the &load_template call works, and what it does when it gets there.

It's not easy to understand at first, but once you see it, it starts to make sense.



[This message has been edited by pugdog (edited March 03, 2000).]