Gossamer Forum
Home : Products : Links 2.0 : Customization :

default url value

Quote Reply
default url value
Hi,

When adding a new link, the user has to put their url in.

Most users forget to put the http:// in front of their website and get a error.

I looked in the templates to change the value for the url, but this value is already in use by $in{'Url'}

In links.def it reads:

Url => [2, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],

How can I put the 'http://' as default in the url-field?

Last edited by:

Foton: Oct 26, 2003, 3:47 PM
Quote Reply
Re: [Foton] default url value In reply to
In the templates directory, find add.html, then add the red part you see below:



<table border ="0" cellspacing="0" cellpadding="0">
<tr><td align="right" valign="top">Title:</td>
<td><input name="Title" size="50"></td></tr>
<tr><td align="right" valign="top">URL:</td>
<td><input name="URL" size="50">http://</td></tr>


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] default url value In reply to
needs to be

Code:
<td><input name="URL" size="50" value="http://"></td></tr>




might even want to add a maxlength tag


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] default url value In reply to
Oops! Blush

Yeah, brain fade ya know... Crazy

I shoulda copied my code, instead of the standard-issue code. Unsure


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Oct 26, 2003, 6:52 PM
Quote Reply
Re: [PerlFlunkie] default url value In reply to
Thanks esm and Perlflunkie, that was the rightr location for it.

BTW; it was not URL but Url, so the right line reads;

<td><input name="Url" size="50" value="http://"></td></tr>

Thanks a lot!

Last edited by:

Foton: Oct 27, 2003, 2:39 AM
Quote Reply
Re: [Foton] default url value In reply to
Hmmm... the code I posted came direct from the download version of Links...

Anyway, glad it works for ya!


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] default url value In reply to
In Reply To:
Oops! Blush

Yeah, brain fade ya know... Crazy

I shoulda copied my code, instead of the standard-issue code. Unsure


yep, been there, done that!


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [Foton] default url value In reply to
In Reply To:
Thanks esm and Perlflunkie, that was the rightr location for it.

BTW; it was not URL but Url, so the right line reads;

<td><input name="Url" size="50" value="http://"></td></tr>

Thanks a lot!


it really depends on what is in the %db_def section of your links.def file. Perl is case sensitive so use whatever is there.

Links 2.0 comes standard with the following:

Code:
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [6, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [9, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes']


And,generally, I would not changes any of the field names as some are imbedded in the program.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] default url value In reply to
Your right!

I translated the whole script and thereby changed the URL in Url.

Sorry for the confusion...Crazy
Quote Reply
Re: [Foton] default url value In reply to
No problem Smile


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."