Search the Community
Showing results for tags 'field context'.
-
I am building a simple admin module with a custom user registration form. The form displays fields from the user template. In the user template, I have set the 'email' field to required. This is an override, because the field itself is not required. So the field is only required in the context of the user template. However, when creating a new user form with the API, this override seems to be ignored and the email field is not required. Am I missing something? This is my code: // Make a form. $form = $modules->get('InputfieldForm'); $form->method = 'post'; $form->action = './'; // Add the user template's fields to the form. $fields = $templates->get("user")->fieldgroup; foreach($fields as $field) { // Do not display certain system fields. $skip = array('admin_theme', 'language', 'roles', 'pass'); if (in_array($field->name, $skip)) continue; $inputfield = $fields->get($field->name)->getInputfield(new user()); $form->add($inputfield); }
-
I think most of us know that the wysiwig editors can be a pain if you want to input more than just some paragraphs... e.g. if you have to work with nested divs in the body of a page. So for some pages, the editor is best left switched off. Only solution i can think of at the moment is to create a new template, a new field for body content without editor, and assign the template to the page. Works, but is cumbersome. It would be extremely helpful if we could switch the editor on and off via field context settings. What do you think? Is this even possible?