Gossamer Forum
Home : Products : Links 2.0 : Customization :

Assist Please: Links Def and Checkboxes - Correct Format Help!

Quote Reply
Assist Please: Links Def and Checkboxes - Correct Format Help!
I'm adding new fields for a list of activites for a site in links.def and want the user to choose if his or her holiday activity centre has a certain type of activity using a CHECKBOX (obviously, check yes or no) on the Add page. I'm using templates.

Is this the right format to do this? (in links.def):

Climbing => [23, 'alpha', 10, 10, 1, 'No', 'No|Yes'],
Skiing => [24, 'alpha', 10, 10, 1, 'No', 'No|Yes'],
Boating => [25, 'alpha', 10, 10, 1, 'No', 'No|Yes'],

Secondly - How would I also only display the ones that have been checked using templates?

Thank you!
Quote Reply
Re: [boom] Assist Please: Links Def and Checkboxes - Correct Format Help! In reply to
Looks like you're on the right track. For your second question, I THINK an if statement is what you need:

<%if [23]="yes"%>
Climbing
<%endif%>

Actually, that probably won't work like it is, but might give you an idea...sorry, my thinker is off todayUnsure


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: May 16, 2003, 1:14 PM
Quote Reply
Re: [boom] Assist Please: Links Def and Checkboxes - Correct Format Help! In reply to
just to add to PerlFlunkie'c comments:

In the add.html you could have something like

Code:
<input type=radio name=Boating value=Yes>Yes &nbsp;&nbsp;<input type=radio name=Boating value=No checked> No


then in the link.html page you could have something like

Code:
Boating:<%if Boating="Yes"%> Available
<%endif%>
<%if Boating="No"%> Not Available
<%endif%>


you have to use the actual field name and not the field number in templates


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Assist Please: Links Def and Checkboxes - Correct Format Help! In reply to
Thanks to both of you... I've done that and it seems to be okay for now... but..

When I'm in Admin and wanting to add a record I see this (for example):

Sailing: No
Surfing: No

How do I make them Checkboxes so I can tick them if they are available? (you know, nice little ticks next to them!)

In Links.def I see the following, but nothing for defining checkboxes:

Hash of column names to radio values. If you use &build_radio_field, it will
make a <INPUT TYPE="RADIO"> tag for you using the options specified in the hash.
%db_radio_fields = ( );



Do you know what I'm going on about?! Blush

Thanks again - really appreciate the replies!

Last edited by:

boom: May 16, 2003, 5:03 PM
Quote Reply
Re: [boom] Assist Please: Links Def and Checkboxes - Correct Format Help! In reply to
Did you add your new fields to this, in links.def:

# Hash of column names to possible options. If you want to use a select form
# field, you can use &build_select_field in your HTML page. This routine will
# make a <SELECT> input tag using the following values:
%db_select_fields = (
isNew => 'Yes,No',
isPopular => 'Yes,No',
ReceiveMail => 'Yes,No'
);


Add yours, just change the name to climbing, etc. Case sensitive...

For a radio field, add the same information between the blank () you posted, instead of the above code.

I'm fiddling with a new script, and my mental rresources are being consumed there...Crazy


Leonard
aka PerlFlunkie