
Universities have a long history of inter-organisation collaboration and for an organisation that has the scale and diversity of our own we have a fantastic opportunity to make the most of our own rich sets of skills, experiences and specialisms. This is exactly what a community of practice should be about. Working here at Edinburgh University I have seen fantastic work going on in my own department and Division but also in the Schools and of course in other parts of Information Services.įrom working with UCISA as Vice Chair for the Infrastructure Group I have gained connections and contacts who have been great sources of information, ideas, new ways of thinking and these have really translated into tangible results.
#Drupal 8 form api example how to
Or perhaps you prefer meeting people and talking about your and their experiences? What about situations where you really need some advice or a second opinion on a method or how to apply a standard in some way?Ī community of practice does all of this but lots moreĬommunities of practice are a great way of getting people to connect and talk about a common area of interest. Therefore to be able to change it we need to do it after user.module sets it, which can be done in additional submit function, called after user.module's submit.Imagine having access to a safe environment where you can ask all sorts of subject related questions. Unfortunately setting $form_state (or $form in D6, which was removed in D7) will not work in this case, as user.module sets redirect in its own user_login_submit() function. This is something we need to change first. Extra submit function - redirecting users to Terms & Conditions page after first loginīy default, right after logging in, users are redirected to their profile page. In our case though, because user accounts are being created only by administrators, it gets a bit more tricky.

In normal circumstances users create their accounts themselves, and redirecting them to T&Cs page after creating an account is pretty easy (there are even modules doing exactly this).

There are scenarios though which could seems a little bit more tricky, at least at the first sight.įor example let's imagine a situation, in which on our site new user accounts could be created only by administrators, and right after user logging in for a very first time we want to show them Terms & Conditions page and require them to agree to those T&Cs before being able to use the site. Manipulating such forms sometimes is as easy as implementing hook_form_alter() in our module and adding/updating/removing form elements or parameters. This feature comes very handy each time there is a need to change default form content or behavior - especially in case of all core forms or those provided by other contrib modules, where we cannot really change them directly in code/module source code.


Even better, ANY form (even those in core) can be altered in almost any way imaginable - elements can be removed, added, and rearranged. The Drupal Form API provides sophisticated form techniques and also allows for almost unlimited possibilities for custom theming, validation, and execution of forms.
