Login | Forgot password | Register
What is OpenID?
OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.
With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.
For more information visit the official OpenID site.
Archive
SilverStripe Forums » Archive » New page type: Specifying required fields
Our old forums are still available as a read-only archive.
|
Page:
1
|
Go to End | |
| Author | Topic: New page type: Specifying required fields | 872 Views |
-
New page type: Specifying required fields

20 May 2008 at 7:09am
When creating a new page type, you can specify extra fields. Is it possible to specify if these fields are mandatory or optional to fill in (when a new page is created)?
-
Re: New page type: Specifying required fields

20 May 2008 at 9:44am
Afaik validation in the cms doesn't work, so there's not a way to 'force' some fields to be filled out. This might be changed in the latest versions though, I'm not aware of that.
You could add some literalfields to the getCMSFields() method though in which you specify/explain which fields are mandatory.
-
Re: New page type: Specifying required fields

31 May 2008 at 3:41am Last edited: 31 May 2008 3:42am
dio5, can you post an example of how to do it please?
I've already tried to do something like this:function getCMSFields() {
$fields = parent::getCMSFields();...
new RequiredFields('Name', 'Age', 'City');...
return $fields;
}
I can't get this to work, if you could give an example I would appreciate.
Thank you in advance. -
Re: New page type: Specifying required fields

31 May 2008 at 3:46am
Euhm, you can't. Like I said, there is no validation in the cms.
| 872 Views | ||
|
Page:
1
|
Go to Top |
Currently Online: cardinale, ikhwanb, spierala, RichardWGP, steeeo
Welcome to our latest member: RichardWGP



