Gossamer Forum
Home : Products : Gossamer Links : Discussions :

include.form.html recognize categoryID?

Quote Reply
include.form.html recognize categoryID?
Hi,
Is there a way to make the add.cgi recognize the CategoryID when the add.cgi is brought up?

What I'm attempting to do is to have two sets of forms, the first one is my regular add form, the second form is a stripped down version that only requires the user to add one field (the rest will be added through hidden tags.

So what I've got is at the beginning of my include_form.html is:
<%if CategoryID eq 49%>NEW MEMBER FEATURE FORM COMING SOON
<%else%> THE EXISTING FORM IS HERE
<%endif%>

I'm calling add.cgi specifically as add.cgi?ID=49
But when I call add.cgi?ID=49 it still brings up the regular form and not just the text of NEW MEMBER FEATURE FORM COMING SOON like I would have thought it would.

Is there some other way of doing this?
Quote Reply
Re: [Westin] include.form.html recognize categoryID? In reply to
Of course it might just be easier if I could pass the form name to add.cgi such like add.cgi?form=include_form2.html
Quote Reply
Re: [Westin] include.form.html recognize categoryID? In reply to
I actually just posted something like this for someone else ;)

Just use:

Code:
<%if not CatID%>
<%set CatID = $ID%>
<%endif%>

<%if CatID == 43 or CatID == 56 or CatID == 23%>
show one form
<%else%>
show another form
<%endif%>

Also, be sure to put in:
Code:
<input type="hidden" name="CatID" value="<%CatID%>" />

..so that it passes along the CatID value.

Its a bit more complex than you were thinking, but it will save you issues further down the line (cos if you pass in "ID", then I think you will get an error about duplicate ID's, as GLinks will try and pass that along as the new link ID (which it shouldn't)

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] include.form.html recognize categoryID? In reply to
Never mind, it might have been my fault. I think it's functioning now, I think I left over an extra <%endif%> at the very bottom of the include.form.html when I was trying it my way earlier today.





Disregard below for the moment until I do further testing.

Interesting, maybe I don't quite understand how it functions.

I put this at the top of my existing include_form.html file:
Code:
<%if not CatID%>
<%set CatID = $ID%>
<%endif%>

<%if CatID == 49%>
Members new Ad form coming soon.
<input type="hidden" name="CatID" value="<%CatID%>" />
<%else%>
show another form
AND ALL THE CONTENTS OF MY ORIGINAL include_form.html
<%endif%>


And what I end up getting is that when I just go to add.cgti, I see

show another form
AND THEN ALL THE CONTENTS OF THE ORIGINAL FORM LIKE I SHOULD.

However when I go to add.cgi?ID=49
I see

Members new Ad form coming soon. (like I should)

But then it continues to show me the rest of the original include.form.html file.

It's as if it doesn't stop at the <%else%> code, it shows both instead.

I hope that made sence.

Last edited by:

Westin: Apr 27, 2009, 2:05 AM
Quote Reply
Re: [Westin] include.form.html recognize categoryID? In reply to
Hi,

Bit hard to see really, without seeing your full add.html / include_form.html code (email it over if you want, and I'll have a quick peek)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] include.form.html recognize categoryID? In reply to
What does the coding below actually represent?

Is it telling the system that if the CatID equals 43 or if the CatID equals 56 or if the CatID equals 23 then show form?

Or is it doing the opposite and saying, if the catID is not 43 or 56 or 23 then show this form?

<%if CatID == 43 or CatID == 56 or CatID == 23%>
Quote Reply
Re: [Westin] include.form.html recognize categoryID? In reply to
Hi,

Yup, exactly - if it matches those conditions, show one form - otherwise, show the other.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!