Most often we may want to show our custom forms in blocks. Here are the simple steps to accomplish this. In the below code we will create a form called “MymoduleExampleForm” and this form will be placed in a custom block called “MymoduleExampleBlock”. Step 1 – Create a custom module say 'mymodule'. For details on how to create a custom module in Drupal 8 See here Step 2 – Create a php file named MymoduleExampleForm.php in mymodule/src/Form and place the following code.
Drupal Technical | 2 min read
Fivestar module is a simple module that adds a "rating star" widget to the nodes. This module displays number of stars that you set; a click from a reader rates the page with that number. We can create custom widgets for changing the color of stars or for showing any other images instead of stars. For example, we can use symbols like a diamond, banana, flower etc.
We had a requirement to show the group field in user registration form using Organic groups. Inorder to show group field in user registration form first we have to install the Organic Groups module (OG), Organic groups register module and create an Organic Group.