Gossamer Forum
Home : Products : Links 2.0 : Customization :

fields of db_def

Quote Reply
fields of db_def
I am having trouble figuring out what the different sections are in %db_def... I'am trying to add a few fields.

Also, would there be any problems in deleting Contact Name and Contact E-mail fields?

Quote Reply
Re: fields of db_def In reply to
It's easiest if you add them at the bottom, because then you don't mess up the numbering and have to change other parts of the file. The parts of this definition go like this:

ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],

First the name of your field and the => symbol. Inside the brackets:

Number of the field (the order it's listed here)

"numer" or "alpha" -- use numer if you only want people to be able to input numbers, alpha if you want them to be able to input letters or numbers ( like a "phone number" ).

How long do you want the input field to be. Use 0 if it's a select field or a radio field. Use a digit like 40 if it's a text field. Use something like 40x3 if you want a textarea field for things like reviews, etc.

The next number is the maximum number of characters you want the field to be able to hold.

The next number is either a 1 or a 0... 1 means a required field. 0 means it can be left blank.

Next you'll see ''. You can put text in here if you want that to be the default text for the admin on the field. For instance on Contact Name and Contact Email, I've put in my name and email address.

The above only effects the admin, not the user add form.

The final '' for format. if you want to be sure that the text put in to that field is an email address, you can specify that here if you know how to use the code... which I don't.

Basically you can just copy one of the currently existing definitions and alter it based on those parameters to suit your needs.

( from another post )