Difference between revisions of "Drupal/C2/User-group-and-Entity-Reference/English-timed"
From Script | Spoken-Tutorial
PoojaMoolya (Talk | contribs) (Created page with " {| Border =1 | <center>Time</center> | <center>Narration</center> |- | 00:01 | Welcome to the spoken tutorial on''' User Group and Entity Reference.''' |- |00:06 | In this...") |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
{| Border =1 | {| Border =1 | ||
− | | | + | | '''Time''' |
− | | | + | | '''Narration''' |
− | + | ||
|- | |- | ||
| 00:01 | | 00:01 | ||
− | | Welcome to the spoken tutorial on''' User Group and Entity Reference.''' | + | | Welcome to the '''spoken tutorial''' on''' User Group and Entity Reference.''' |
|- | |- | ||
|00:06 | |00:06 | ||
− | | In this tutorial, we will learn to | + | |In this tutorial, we will learn to: |
+ | Create '''User Group Content type''' | ||
|- | |- | ||
| 00:11 | | 00:11 | ||
− | |Add '''User Group '''fields and | + | | |
+ | Add '''User Group '''fields and | ||
+ | Connect '''Content types '''with '''Entity reference'''. | ||
|- | |- | ||
| 00:18 | | 00:18 | ||
− | | To record this tutorial, I am using | + | | To record this tutorial, I am using: |
− | + | '''Ubuntu Operating System''' | |
− | + | '''Drupal 8''' and | |
− | + | '''Firefox''' web browser. | |
− | + | ||
|- | |- | ||
Line 38: | Line 38: | ||
|- | |- | ||
| 00:42 | | 00:42 | ||
− | | To create the '''Event Sponsor | + | | To create the '''Event Sponsor''' field, we need to create the ''''User Groups' Content type'''. |
|- | |- | ||
| 00:48 | | 00:48 | ||
− | | '''User Groups''' are a group of people who come together to | + | | '''User Groups''' are a group of people who come together to organize an event. |
|- | |- | ||
| 00:54 | | 00:54 | ||
− | |Examples could be '''Cincinnati User group''', '''Drupal Mumbai group''', '''Bangalore Drupal group''' | + | |Examples could be- '''Cincinnati User group''', '''Drupal Mumbai group''', '''Bangalore Drupal group''' etc. |
|- | |- | ||
Line 62: | Line 62: | ||
|- | |- | ||
| 01:23 | | 01:23 | ||
− | | A person’s name can be captured by a '''Name | + | | A person’s name can be captured by a '''Name''' field. But we will use '''Text (plain)''' for now. |
|- | |- | ||
| 01:31 | | 01:31 | ||
− | | User experience levels can be one of | + | | User experience levels can be one of "Beginner, Intermediate" or "Advanced". |
|- | |- | ||
| 01:39 | | 01:39 | ||
− | | To implement this, we will choose a | + | | To implement this, we will choose a "List (text)" '''Field Type'''. |
|- | |- | ||
Line 82: | Line 82: | ||
|- | |- | ||
| 02:01 | | 02:01 | ||
− | | Let's set up''' User Groups Content type'''. | + | | Let's set up''' 'User Groups' Content type'''. |
|- | |- | ||
| 02:05 | | 02:05 | ||
− | | Click''' Add content type.''' Let’s name this one as | + | | Click''' Add content type.''' Let’s name this one as "User Groups". |
|- | |- | ||
Line 94: | Line 94: | ||
|- | |- | ||
| 02:16 | | 02:16 | ||
− | | In the''' Description''', type | + | | In the''' Description''', type: "This is where we track the Drupal groups from around the world". |
|- | |- | ||
| 02:23 | | 02:23 | ||
− | | In the''' Title field label''' we will name this as | + | | In the''' Title field label''', we will name this as "User Group Name". |
|- | |- | ||
Line 106: | Line 106: | ||
|- | |- | ||
| 02:35 | | 02:35 | ||
− | |Click on''' Publishing options | + | |Click on''' Publishing options''' tab. |
|- | |- | ||
| 02:38 | | 02:38 | ||
− | | Under''' Default options''', let’s check the boxes for | + | | Under''' Default options''', let’s check the boxes for- |
− | + | '''Create new revision''' | |
− | + | '''Published''' and | |
− | + | '''Promoted to front page.''' | |
− | + | ||
|- | |- | ||
| 02:48 | | 02:48 | ||
− | | Now click on''' Display settings | + | | Now, click on''' Display settings''' tab. |
|- | |- | ||
Line 126: | Line 125: | ||
|- | |- | ||
| 02:58 | | 02:58 | ||
− | | Lastly, click on''' Menu settings | + | | Lastly, click on''' Menu settings''' tab and uncheck the box for''' Main navigation'''. |
|- | |- | ||
Line 138: | Line 137: | ||
|- | |- | ||
| 03:17 | | 03:17 | ||
− | | Here let's change the''' Label''' for the''' Body.''' | + | | Here, let's change the''' Label''' for the''' Body.''' |
|- | |- | ||
Line 146: | Line 145: | ||
|- | |- | ||
| 03:26 | | 03:26 | ||
− | | In the''' Label | + | | In the''' Label''' field, let’s type: "User Group Description" and then click on the''' Save settings''' button at the bottom. |
|- | |- | ||
Line 154: | Line 153: | ||
|- | |- | ||
| 03:40 | | 03:40 | ||
− | | For this''' Content type,''' we are only going to set up 5 | + | | For this''' Content type,''' we are only going to set up 5 fields. |
|- | |- | ||
| 03:46 | | 03:46 | ||
− | | We have already created one | + | | We have already created one field. Let's now create another one. |
|- | |- | ||
Line 166: | Line 165: | ||
|- | |- | ||
| 03:55 | | 03:55 | ||
− | | In this case, we will click on''' | + | | In this case, we will click on''' Re-use an existing field''' drop-down. |
|- | |- | ||
| 04:02 | | 04:02 | ||
− | | Notice that''' Link: field_event_ website | + | | Notice that''' Link: field_event_ website''' field is available. |
|- | |- | ||
Line 178: | Line 177: | ||
|- | |- | ||
| 04:13 | | 04:13 | ||
− | | Re-using a | + | | Re-using a field allows us to re-use a''' table''' in the Drupal database. |
|- | |- | ||
| 04:20 | | 04:20 | ||
− | | This is done by maintaining different settings for the same | + | | This is done by maintaining different settings for the same field. |
|- | |- | ||
| 04:25 | | 04:25 | ||
− | | In this case, it makes more sense to set up a new | + | | In this case, it makes more sense to set up a new field. |
|- | |- | ||
| 04:30 | | 04:30 | ||
− | | In''' Add a new field''' | + | | In''' Add a new field''' drop-down, choose the '''"Link" field type'''. |
|- | |- | ||
| 04:35 | | 04:35 | ||
− | |In''' Label''', type | + | |In''' Label''', type "Group Website". |
|- | |- | ||
| 04:39 | | 04:39 | ||
− | | Click''' Save and continue | + | | Click''' Save and continue''' and then click''' Save field settings.''' |
|- | |- | ||
| 04:45 | | 04:45 | ||
− | | This time we will select''' External links only''', since no''' User Groups''' actually has a page in | + | | This time, we will select''' External links only''', since no''' User Groups''' actually has a page in "Drupalville" yet. |
|- | |- | ||
Line 214: | Line 213: | ||
|- | |- | ||
| 05:01 | | 05:01 | ||
− | |This time we will use a''' Text | + | |This time, we will use a''' Text''' field for the contact person’s name. |
|- | |- | ||
| 05:07 | | 05:07 | ||
− | | Click on''' Add a new field''' | + | | Click on''' Add a new field''' drop-down and choose the '''field type "Text (plain)".''' |
|- | |- | ||
| 05:14 | | 05:14 | ||
− | |We will name the '''Label''' as | + | |We will name the '''Label''' as "Group Contact". |
|- | |- | ||
| 05:18 | | 05:18 | ||
− | | Click''' Save and continue''' | + | | Click''' Save and continue''' and then''' Save field settings.''' |
|- | |- | ||
Line 234: | Line 233: | ||
|- | |- | ||
| 05:28 | | 05:28 | ||
− | | Once more, click on''' Add field''' button. This time, let’s choose the | + | | Once more, click on''' Add field''' button. This time, let’s choose the "Email" field in the drop-down. |
|- | |- | ||
| 05:37 | | 05:37 | ||
− | |We will name the '''Label''' as | + | |We will name the '''Label''' as "Contact Email".''' Click on''' Save and continue''' button. |
|- | |- | ||
Line 254: | Line 253: | ||
|- | |- | ||
| 06:03 | | 06:03 | ||
− | | This time, in the '''Field type ''' | + | | This time, in the '''Field type '''drop-down, select the "List (text)" option. |
|- | |- | ||
| 06:09 | | 06:09 | ||
− | | In the''' Label | + | | In the''' Label''' field, we will type "Group Experience" and then click''' Save and continue''' button. |
|- | |- | ||
| 06:16 | | 06:16 | ||
− | | One of the things about this '''Field type '''that should be kept in mind, is given in this message. | + | | One of the things about this '''Field type ''' that should be kept in mind, is given in this message. |
|- | |- | ||
| 06:23 | | 06:23 | ||
− | | | + | |"These settings impact the way the data is stored in the database and cannot be changed once data has been created". |
|- | |- | ||
Line 274: | Line 273: | ||
|- | |- | ||
| 06:37 | | 06:37 | ||
− | | Let’s add our values here - | + | | Let’s add our values here - "Beginner, Intermediate, Advanced" and "Expert". |
|- | |- | ||
Line 290: | Line 289: | ||
|- | |- | ||
| 07:04 | | 07:04 | ||
− | | We have one more | + | | We have one more field to add here, that is the''' Entity reference field'''. |
|- | |- | ||
Line 298: | Line 297: | ||
|- | |- | ||
| 07:17 | | 07:17 | ||
− | | One of the things we want to do in our website | + | | One of the things we want to do in our website is to say that - '''Events''' can be sponsored by''' User Groups''' and '''User Groups''' can sponsor''' Events'''. |
|- | |- | ||
| 07:28 | | 07:28 | ||
− | | This is a very common thing in a | + | | This is a very common thing in a website where you want to '''link''' two different contents together. |
|- | |- | ||
Line 310: | Line 309: | ||
|- | |- | ||
| 07:45 | | 07:45 | ||
− | | Now let’s set this up. Click on''' Add field.''' | + | | Now, let’s set this up. Click on''' Add field.''' |
|- | |- | ||
Line 318: | Line 317: | ||
|- | |- | ||
| 07:57 | | 07:57 | ||
− | | Click on''' Add a new field''' | + | | Click on''' Add a new field''' drop-down. This time, choose''' Content''' under''' Reference.''' |
|- | |- | ||
| 08:04 | | 08:04 | ||
− | |In the''' Label''' field, we will type | + | |In the''' Label''' field, we will type "Events Sponsored" and then click''' Save and continue''' button. |
|- | |- | ||
Line 346: | Line 345: | ||
|- | |- | ||
| 08:34 | | 08:34 | ||
− | | Here on the''' Settings''' page, we get to choose which''' Content types''' are referenced by the''' User Groups.''' | + | | Here, on the''' Settings''' page, we get to choose which''' Content types''' are referenced by the''' User Groups.''' |
|- | |- | ||
| 08:42 | | 08:42 | ||
− | | We are referencing ''' Events Content type.''' | + | | We are referencing ''' 'Events' Content type.''' |
|- | |- | ||
| 08:46 | | 08:46 | ||
− | |Here when I am adding an event, only the events will show up when I start typing the''' Events title.''' | + | |Here, when I am adding an event, only the events will show up when I start typing the''' Events title.''' |
|- | |- | ||
Line 362: | Line 361: | ||
|- | |- | ||
| 09:01 | | 09:01 | ||
− | | Choose''' Events''' and click''' Save settings''' | + | | Choose''' Events''' and click''' Save settings'''. |
|- | |- | ||
Line 370: | Line 369: | ||
|- | |- | ||
| 09:10 | | 09:10 | ||
− | | Click on''' Structure.''' Then click on''' Content types''' here in the bread crumbs. | + | | Click on''' Structure.''' Then click on''' Content types''' here, in the '''bread crumbs'''. |
|- | |- | ||
Line 378: | Line 377: | ||
|- | |- | ||
| 09:21 | | 09:21 | ||
− | | Let's add one more | + | | Let's add one more field. Under''' Add a new field''' drop-down, choose''' Content.''' |
|- | |- | ||
| 09:28 | | 09:28 | ||
− | |In the''' Label''' field, type | + | |In the''' Label''' field, type: "Event Sponsors". |
|- | |- | ||
Line 390: | Line 389: | ||
|- | |- | ||
| 09:34 | | 09:34 | ||
− | | Change''' Allowed number of values''' | + | | Change''' Allowed number of values'''; let’s choose''' Unlimited.''' |
|- | |- | ||
| 09:39 | | 09:39 | ||
− | |This is because more than one''' User Group''' could sponsor an event. Now click on''' Save field settings.''' | + | |This is because more than one''' User Group''' could sponsor an event. Now, click on''' Save field settings.''' |
|- | |- | ||
| 09:48 | | 09:48 | ||
− | | This time under''' REFERENCE TYPE,''' choose''' User groups.''' | + | | This time, under''' REFERENCE TYPE,''' choose''' User groups.''' |
|- | |- | ||
Line 410: | Line 409: | ||
|- | |- | ||
| 10:01 | | 10:01 | ||
− | | Now this links those ''' | + | | Now, this links those two '''Content Types''' together in a''' many to many relationship.''' |
|- | |- | ||
| 10:08 | | 10:08 | ||
− | |These are based on''' ''' | + | |These are based on '''events sponsors''' and what '''Events''' are being sponsored by what''' User Groups.''' |
|- | |- | ||
| 10:16 | | 10:16 | ||
− | |With this we come to the end of this tutorial. Let us summarize. | + | |With this, we come to the end of this tutorial. Let us summarize. |
|- | |- | ||
| 10:22 | | 10:22 | ||
− | |In this tutorial we have learnt to | + | |In this tutorial, we have learnt to: |
+ | Create '''User Group Content type''' | ||
|- | |- | ||
| 10:28 | | 10:28 | ||
− | |Add '''User Group '''fields and | + | | |
+ | Add '''User Group '''fields and | ||
+ | Connect '''Content types '''with '''Entity reference'''. | ||
|- | |- | ||
| 10:40 | | 10:40 | ||
− | | This video is adapted from Acquia and OSTraining and revised by Spoken Tutorial Project, IIT Bombay. | + | | This video is adapted from '''Acquia''' and '''OSTraining''' and revised by '''Spoken Tutorial Project, IIT Bombay'''. |
|- | |- | ||
| 10:51 | | 10:51 | ||
− | | The video at this link | + | | The video at this link summarizes the Spoken Tutorial project. Please download and watch it. |
|- | |- | ||
| 10:58 | | 10:58 | ||
− | | The Spoken Tutorial Project | + | | The Spoken Tutorial Project team conducts workshops and gives certificates. For more details, please write to us. |
|- | |- | ||
| 11:07 | | 11:07 | ||
− | | Spoken Tutorial Project is funded by | + | | Spoken Tutorial Project is funded by NMEICT, Ministry of Human Resource Development and NVLI, Ministry of Culture, Government of India. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | Government of India. | + | |
|- | |- | ||
| 11:21 | | 11:21 | ||
− | | This is Gautam Narayanan signing off. Thanks for joining. | + | |This is Gautam Narayanan, signing off. Thanks for joining. |
|} | |} |
Latest revision as of 17:36, 24 March 2017
Time | Narration |
00:01 | Welcome to the spoken tutorial on User Group and Entity Reference. |
00:06 | In this tutorial, we will learn to:
Create User Group Content type |
00:11 |
Add User Group fields and Connect Content types with Entity reference. |
00:18 | To record this tutorial, I am using:
Ubuntu Operating System Drupal 8 and Firefox web browser. |
00:27 | You can use any web browser as per your choice. |
00:32 | Let us recall the Events Content type we created in the previous tutorial. |
00:38 | We had created the first five fields shown here. |
00:42 | To create the Event Sponsor field, we need to create the 'User Groups' Content type. |
00:48 | User Groups are a group of people who come together to organize an event. |
00:54 | Examples could be- Cincinnati User group, Drupal Mumbai group, Bangalore Drupal group etc. |
01:03 | Let us first design the User Groups on a paper. |
01:07 | A group can have a website, a contact person, their email and their experience level. |
01:15 | Drupal has default fields for URL and Email, so we have chosen these field types. |
01:23 | A person’s name can be captured by a Name field. But we will use Text (plain) for now. |
01:31 | User experience levels can be one of "Beginner, Intermediate" or "Advanced". |
01:39 | To implement this, we will choose a "List (text)" Field Type. |
01:45 | The last field here is for capturing all the events sponsored by this group. |
01:51 | For this, we can use Entity reference field to link to an existing Events Content type. |
02:01 | Let's set up 'User Groups' Content type. |
02:05 | Click Add content type. Let’s name this one as "User Groups". |
02:11 | Notice that the Machine name is user underscore groups. |
02:16 | In the Description, type: "This is where we track the Drupal groups from around the world". |
02:23 | In the Title field label, we will name this as "User Group Name". |
02:29 | Let's set this up in the same manner as our Events Content type. |
02:35 | Click on Publishing options tab. |
02:38 | Under Default options, let’s check the boxes for-
Create new revision Published and Promoted to front page. |
02:48 | Now, click on Display settings tab. |
02:52 | Then uncheck the box for Display author and date information. |
02:58 | Lastly, click on Menu settings tab and uncheck the box for Main navigation. |
03:05 | Once we have got that set, we can click on Save and manage fields button at the bottom. |
03:13 | We are redirected to Manage fields page. |
03:17 | Here, let's change the Label for the Body. |
03:21 | Click on the Edit button under the Operations column. |
03:26 | In the Label field, let’s type: "User Group Description" and then click on the Save settings button at the bottom. |
03:36 | We can see the green success message at the top. |
03:40 | For this Content type, we are only going to set up 5 fields. |
03:46 | We have already created one field. Let's now create another one. |
03:52 | Click Add field button. |
03:55 | In this case, we will click on Re-use an existing field drop-down. |
04:02 | Notice that Link: field_event_ website field is available. |
04:08 | Because we already named it as Event website. |
04:13 | Re-using a field allows us to re-use a table in the Drupal database. |
04:20 | This is done by maintaining different settings for the same field. |
04:25 | In this case, it makes more sense to set up a new field. |
04:30 | In Add a new field drop-down, choose the "Link" field type. |
04:35 | In Label, type "Group Website". |
04:39 | Click Save and continue and then click Save field settings. |
04:45 | This time, we will select External links only, since no User Groups actually has a page in "Drupalville" yet. |
04:54 | Click Save settings button at the bottom. |
04:57 | Once again, click on Add field. |
05:01 | This time, we will use a Text field for the contact person’s name. |
05:07 | Click on Add a new field drop-down and choose the field type "Text (plain)". |
05:14 | We will name the Label as "Group Contact". |
05:18 | Click Save and continue and then Save field settings. |
05:24 | Then click on the Save settings button at the bottom. |
05:28 | Once more, click on Add field button. This time, let’s choose the "Email" field in the drop-down. |
05:37 | We will name the Label as "Contact Email". Click on Save and continue button. |
05:44 | In Allowed number of values, we need only 1. Click on Save field settings. |
05:52 | There are no other settings here. So, we will click on Save settings button at the bottom. |
05:59 | Once more, click on Add field button. |
06:03 | This time, in the Field type drop-down, select the "List (text)" option. |
06:09 | In the Label field, we will type "Group Experience" and then click Save and continue button. |
06:16 | One of the things about this Field type that should be kept in mind, is given in this message. |
06:23 | "These settings impact the way the data is stored in the database and cannot be changed once data has been created". |
06:32 | This is one of the reasons we emphasize planning. |
06:37 | Let’s add our values here - "Beginner, Intermediate, Advanced" and "Expert". |
06:44 | Our User Group could very easily have more than one of these values applicable to them. |
06:51 | Change Allowed number of values from Limited to Unlimited and then click Save field settings. |
07:01 | Now, click Save settings. |
07:04 | We have one more field to add here, that is the Entity reference field. |
07:10 | Now we learn about what is Entity Reference and how to create it. |
07:17 | One of the things we want to do in our website is to say that - Events can be sponsored by User Groups and User Groups can sponsor Events. |
07:28 | This is a very common thing in a website where you want to link two different contents together. |
07:35 | Events are sponsored by User Groups. So, we want to have the User Group information to be available to every event. |
07:45 | Now, let’s set this up. Click on Add field. |
07:49 | If you are a database person, you will recognize these as a many to many relationship within the data. |
07:57 | Click on Add a new field drop-down. This time, choose Content under Reference. |
08:04 | In the Label field, we will type "Events Sponsored" and then click Save and continue button. |
08:12 | Next, we are asked to choose the Type of item to reference. |
08:17 | You can see there are a lot of options here. |
08:21 | We are going to keep it very simple - choose Content. |
08:26 | In Allowed number of values, let’s choose Unlimited. |
08:31 | Then click Save field settings. |
08:34 | Here, on the Settings page, we get to choose which Content types are referenced by the User Groups. |
08:42 | We are referencing 'Events' Content type. |
08:46 | Here, when I am adding an event, only the events will show up when I start typing the Events title. |
08:55 | Hence, we need to make sure that we have selected the right Content Type here. |
09:01 | Choose Events and click Save settings. |
09:05 | Now, we need to do the same thing in our Events Content type. |
09:10 | Click on Structure. Then click on Content types here, in the bread crumbs. |
09:16 | Then for the Events Content type, select Manage fields. |
09:21 | Let's add one more field. Under Add a new field drop-down, choose Content. |
09:28 | In the Label field, type: "Event Sponsors". |
09:32 | Click Save and continue |
09:34 | Change Allowed number of values; let’s choose Unlimited. |
09:39 | This is because more than one User Group could sponsor an event. Now, click on Save field settings. |
09:48 | This time, under REFERENCE TYPE, choose User groups. |
09:53 | Again, this is because we are referencing User Groups for the Events Sponsors field. |
09:59 | Click Save settings. |
10:01 | Now, this links those two Content Types together in a many to many relationship. |
10:08 | These are based on events sponsors and what Events are being sponsored by what User Groups. |
10:16 | With this, we come to the end of this tutorial. Let us summarize. |
10:22 | In this tutorial, we have learnt to:
Create User Group Content type |
10:28 |
Add User Group fields and Connect Content types with Entity reference. |
10:40 | This video is adapted from Acquia and OSTraining and revised by Spoken Tutorial Project, IIT Bombay. |
10:51 | The video at this link summarizes the Spoken Tutorial project. Please download and watch it. |
10:58 | The Spoken Tutorial Project team conducts workshops and gives certificates. For more details, please write to us. |
11:07 | Spoken Tutorial Project is funded by NMEICT, Ministry of Human Resource Development and NVLI, Ministry of Culture, Government of India. |
11:21 | This is Gautam Narayanan, signing off. Thanks for joining. |