Gossamer Forum
Home : Products : Links 2.0 : Customization :

How to make URL field optional in add records?

Quote Reply
How to make URL field optional in add records?
Hi folks,

I searched for an answer to this but didn't find anything.

I'm trying to make the URL field optional. I'd like to be able to leave it blank if no URL is available, yet be able to have a URL link to the title if it is available.

Thanks,
--Train
Quote Reply
Re: How to make URL field optional in add records? In reply to
In Links v1.1, it's in links.def (it is also in Links 2.0beta, but is not the same). Look for:

Quote:
# Hash of column names that say which columns can not be NULL. A record will
# be accepted if a column has a NULL value even though it might fail the regular
# expression above. You must define the column as not null if you don't want NULL
# entries.
%db_not_null = ( 'ID' => 'yes',
'Title' => 'yes',
'URL' => 'yes',
'Type' => 'yes',
'Date', => 'yes',
'Category' => 'yes',
'Contact Name' => 'yes',
'Contact Email' => 'yes',
'Hits' => 'yes'
);

I hope this helps.

------------------
Bob Connors
bobsie@orphanage.com
www.orphanage.com/goodstuff/
goodstufflists.home.ml.org/


Quote Reply
Re: How to make URL field optional in add records? In reply to
I am converting my existing links (700 of them-yes it will take a while!) to Links 2. Since I don't want to have to put a contact name and e-mail in for all of these links, can I just disable these fields for the admin interface but still require it from the user interface?

If not, can I disable it temporarily while I convert my existing links, then reenable them so that future additions require both fields without the program freaking out? In other words, will I have any problems building pages later on if some records have these fields and some don't?