Difference between revisions of "Drupal/C3/Menu-and-Endpoints/English-timed"
(Created page with "{|border=1 |'''Time''' |'''Narration''' |- | 00:01 | Welcome to the Spoken tutorial on''' Menu and Endpoints.''' |- | 00:06 | In this tutorial, we will learn to set up '...") |
Sandhya.np14 (Talk | contribs) |
||
Line 5: | Line 5: | ||
|- | |- | ||
| 00:01 | | 00:01 | ||
− | | Welcome to the Spoken tutorial on''' Menu and Endpoints.''' | + | | Welcome to the '''Spoken tutorial''' on''' Menu and Endpoints.''' |
|- | |- | ||
| 00:06 | | 00:06 | ||
− | | In this tutorial, we will learn to set up '''URL Patterns.'''We will also learn about '''Menu management'''. | + | | In this tutorial, we will learn to set up '''URL Patterns.''' We will also learn about '''Menu management'''. |
|- | |- | ||
Line 15: | Line 15: | ||
| To record this tutorial, I am using | | To record this tutorial, I am using | ||
* '''Ubuntu Linux''' Operating System | * '''Ubuntu Linux''' Operating System | ||
− | * '''Drupal''' 8 and'''Firefox''' Web browser | + | * '''Drupal''' 8 and |
+ | * '''Firefox''' Web browser. | ||
You can use any web browser as per your choice. | You can use any web browser as per your choice. | ||
|- | |- | ||
| 00:29 | | 00:29 | ||
− | | In this tutorial, we will talk about the process of creating proper''' URL paths''' for our | + | | In this tutorial, we will talk about the process of creating proper''' URL paths''' for our website. |
|- | |- | ||
|00:36 | |00:36 | ||
− | | '''Endpoints''' and '''aliases''' | + | | '''Endpoints''' and '''aliases'''- '''Endpoints''' are '''URL paths''' which display a particular content. |
|- | |- | ||
|00:45 | |00:45 | ||
− | | | + | |By default, in '''Drupal''', the '''endpoint''' of a '''node''' is '''node/[node:id]'''. |
|- | |- | ||
|00:53 | |00:53 | ||
− | | | + | |Sending this to a server will display the contents of the node. A number in the '''ID''' is not human readable. |
|- | |- | ||
| 01:02 | | 01:02 | ||
− | | | + | | That is, we cannot easily associate a particular content with say, '''node/278162''' |
− | + | A human readable '''endpoint''' is available by creating an '''alias'''. | |
|- | |- | ||
|01:19 | |01:19 | ||
− | | | + | |'''Alias''' is an alternate '''URL path''' for the same content. We can use either the original or any one of several aliases, for displaying the same content. |
|- | |- | ||
| 01:34 | | 01:34 | ||
− | | | + | |For example, '''node/278162''' and '''content/drupal-camp-mumbai-2015'''. |
|- | |- | ||
|01:47 | |01:47 | ||
− | | | + | |Both return the same content. The second one is easy to remember. |
|- | |- | ||
|01:54 | |01:54 | ||
− | |Let us now create | + | |Let us now create URL patterns that will apply to all the contents we have. |
|- | |- | ||
Line 61: | Line 62: | ||
|- | |- | ||
| 02:04 | | 02:04 | ||
− | |Those three | + | |Those three modules are the''' Pathauto, Token '''and '''CTools'''. |
|- | |- | ||
| 02:13 | | 02:13 | ||
− | | | + | |Please go ahead and get the''' Pathauto''' installed on your machine. |
|- | |- | ||
| 02:18 | | 02:18 | ||
− | |Come back to the''' Pathauto''' project page.Here, you will notice that''' Pathauto''' requires''' Token '''and '''CTools.''' | + | |Come back to the''' Pathauto''' project page. Here, you will notice that''' Pathauto''' requires''' Token '''and '''CTools.''' |
|- | |- | ||
Line 81: | Line 82: | ||
|- | |- | ||
| 02:40 | | 02:40 | ||
− | | Click on''' Configuration.'''Down here on the left hand side, under the''' SEARCH | + | | Click on''' Configuration.''' Down here, on the left hand side, under the''' SEARCH AND METADATA''' section, you will see''' URL aliases'''. |
|- | |- | ||
Line 89: | Line 90: | ||
|- | |- | ||
|02:58 | |02:58 | ||
− | |Click on the '''Patterns''' tab.Click on the '''Add Pathauto pattern '''button. | + | |Click on the '''Patterns''' tab. Click on the '''Add Pathauto pattern '''button. |
|- | |- | ||
Line 102: | Line 103: | ||
| 03:17 | | 03:17 | ||
| For example, I will select '''Content'''. | | For example, I will select '''Content'''. | ||
− | In the '''Path pattern | + | In the '''Path pattern''' field, we have to provide the pattern template. |
|- | |- | ||
| 03:27 | | 03:27 | ||
− | | Template variables are called as '''tokens'''.They are dynamically generated for each '''entity'''. | + | | Template variables are called as '''tokens'''. They are dynamically generated for each '''entity'''. |
|- | |- | ||
| 03:36 | | 03:36 | ||
− | | '''Token module''' provides these variables.When you see '''Browse available tokens''' in any input form, you can insert pre-defined '''tokens'''. | + | | '''Token module''' provides these variables. When you see '''Browse available tokens''' in any input '''form''', you can insert pre-defined '''tokens'''. |
|- | |- | ||
Line 118: | Line 119: | ||
|- | |- | ||
|03:55 | |03:55 | ||
− | |Type | + | |Type "content/". Then click on the '''Browse available tokens''' link. |
|- | |- | ||
| 04:02 | | 04:02 | ||
− | | A popup window opens up to show the | + | | A popup window opens up to show the "Available tokens". |
|- | |- | ||
| 04:07 | | 04:07 | ||
− | | Suppose we want a pattern like '''content/[title of the page]''' | + | | Suppose we want a pattern like '''content/[title of the page]''', the '''token''' for the title of the page is under the '''Nodes''' section. |
|- | |- | ||
Line 138: | Line 139: | ||
|- | |- | ||
|04:32 | |04:32 | ||
− | |This will insert '''[node:title]'''at the cursor location in the form box. | + | |This will insert '''[node:title]''' at the cursor location in the '''form''' box. |
|- | |- | ||
Line 156: | Line 157: | ||
| 05:04 | | 05:04 | ||
| This setting can also be overridden for a particular '''type'''. | | This setting can also be overridden for a particular '''type'''. | ||
− | Example: we can create '''usergroup/[node:title]'''and apply it only for '''User Group.''' | + | Example: we can create '''usergroup/[node:title]''' and apply it only for '''User Group.''' |
|- | |- | ||
| 05:18 | | 05:18 | ||
− | | In the '''Label | + | | In the '''Label''' field, type "Content Title". Then click on the '''Save''' button. Here, we can check the new pattern we just created. |
|- | |- | ||
| 05:31 | | 05:31 | ||
− | | This pattern will be applied to generate '''URL aliases''' for all newly added | + | | This pattern will be applied to generate '''URL aliases''' for all newly added contents. But it will not create the '''URL aliases''' for existing contents. |
|- | |- | ||
| 05:45 | | 05:45 | ||
− | | To apply it for the existing contents, click on the '''Bulk generate''' tab.Select '''Content type''' and click on the '''Update''' button. | + | | To apply it for the existing contents, click on the '''Bulk generate''' tab. Select '''Content type''' and click on the '''Update''' button. |
|- | |- | ||
| 05:58 | | 05:58 | ||
− | | It is started generating the '''URL aliases'''.It can take a while depending on the number of existing contents. | + | | It is started generating the '''URL aliases'''. It can take a while depending on the number of existing contents. |
|- | |- | ||
| 06:08 | | 06:08 | ||
− | | Now click on the '''List''' tab.We can see that the''' URL aliases''' for our content. | + | | Now click on the '''List''' tab. We can see that the''' URL aliases''' for our content. |
|- | |- | ||
Line 188: | Line 189: | ||
|- | |- | ||
| 06:30 | | 06:30 | ||
− | | We can see that all the''' aliases''' follow the same''' pattern.'''You have to do this each time you create a new''' Content type.''' | + | | We can see that all the''' aliases''' follow the same''' pattern.''' You have to do this each time you create a new''' Content type.''' |
|- | |- | ||
Line 195: | Line 196: | ||
* Use lower case words | * Use lower case words | ||
− | * Do not give space between words | + | * Do not give space between words. |
|- | |- | ||
|06:52 | |06:52 | ||
|* Separate words by hyphen and not '''underscore''' | |* Separate words by hyphen and not '''underscore''' | ||
− | * Use meaningful, human readable words in the '''URL''' for '''search engine | + | * Use meaningful, human readable words in the '''URL''' for '''search engine optimization (SEO)''' |
|- | |- | ||
|07:07 | |07:07 | ||
− | |* Use '''date tokens''' for contents classified by time | + | |* Use '''date tokens''' for contents classified by time. |
|- | |- | ||
Line 213: | Line 214: | ||
|- | |- | ||
| 07:26 | | 07:26 | ||
− | | We also see that by default several common words are removed from the pattern. | + | | We also see that, by default, several common words are removed from the pattern. |
This is to keep the '''endpoint''' compact and meaningful. | This is to keep the '''endpoint''' compact and meaningful. | ||
|- | |- | ||
| 07:38 | | 07:38 | ||
− | | To | + | | To summarize - |
'''Pathauto''' and''' Token modules''' allow us to | '''Pathauto''' and''' Token modules''' allow us to | ||
* set up''' URL patterns''' | * set up''' URL patterns''' | ||
Line 228: | Line 229: | ||
|- | |- | ||
| 07:52 | | 07:52 | ||
− | | From now onwards, every new | + | | From now onwards, every new node will use the '''patterns''' that we have established. |
|- | |- | ||
Line 236: | Line 237: | ||
|- | |- | ||
| 08:03 | | 08:03 | ||
− | | We have been adding | + | | We have been adding menus to our site, in a random order, mostly based on the''' Views''' and basic pages. |
|- | |- | ||
| 08:10 | | 08:10 | ||
− | | Now, let’s see how we can manage the | + | | Now, let’s see how we can manage the menu system. |
|- | |- | ||
Line 248: | Line 249: | ||
|- | |- | ||
| 08:21 | | 08:21 | ||
− | | We have a number of different | + | | We have a number of different menus here that come with Drupal, by default. |
− | We have | + | We have six menus, to be exact. |
|- | |- | ||
| 08:31 | | 08:31 | ||
− | | We are interested in the''' Main navigation menu.'''So click on''' Edit menu.''' | + | | We are interested in the''' Main navigation menu.''' So, click on''' Edit menu.''' |
|- | |- | ||
| 08:38 | | 08:38 | ||
− | | Here we will be able to click and drag and re-order our | + | | Here, we will be able to click and drag and re-order our Menu links. |
|- | |- | ||
Line 265: | Line 266: | ||
|- | |- | ||
| 08:49 | | 08:49 | ||
− | | You can re-order these, in any way you want.Once done, click''' Save.''' | + | | You can re-order these, in any way you want. Once done, click''' Save.''' |
|- | |- | ||
Line 278: | Line 279: | ||
|- | |- | ||
| 09:10 | | 09:10 | ||
− | | That’s pretty simple.Click''' Save''' and take a look at our front page. | + | | That’s pretty simple. Click''' Save''' and take a look at our front page. |
|- | |- | ||
| 09:15 | | 09:15 | ||
− | | Notice that now | + | | Notice that now we have got four menus. |
|- | |- | ||
Line 290: | Line 291: | ||
|- | |- | ||
| 09:23 | | 09:23 | ||
− | | Please remember, not all ''' themes''' in | + | | Please remember, not all ''' themes''' in Drupal support sub menus or drop-down menus. ''''Bartick theme''' is one of them. |
|- | |- | ||
Line 303: | Line 304: | ||
|- | |- | ||
| 09:51 | | 09:51 | ||
− | | For instance if I wanted a menu link for my''' Forums,''' I would first go back to the''' site.''' | + | | For instance, if I wanted a menu link for my''' Forums,''' I would first go back to the''' site.''' |
|- | |- | ||
| 09:58 | | 09:58 | ||
− | | Go to the''' Forums page''' and copy the actual''' URL | + | | Go to the''' Forums page''' and copy the actual''' URL''' which is just''' /forum'''. |
|- | |- | ||
Line 315: | Line 316: | ||
|- | |- | ||
| 10:12 | | 10:12 | ||
− | | Give it a''' title''' called''' Forum''' and | + | | Give it a''' title''' called''' Forum''' and '''paste''' the copied link. |
|- | |- | ||
| 10:17 | | 10:17 | ||
− | | If you are looking at a specific piece of content, just type a letter like | + | | If you are looking at a specific piece of content, just type a letter like ' F' or 'G'. |
− | All the | + | All the nodes that start with that letter, will show up. |
|- | |- | ||
| 10:28 | | 10:28 | ||
− | | Say for instance if we type an | + | | Say, for instance, if we type an 'a' , all the nodes that have 'a' in the''' title,''' will show up. |
|- | |- | ||
Line 337: | Line 338: | ||
| 10:56 | | 10:56 | ||
| If we want to link it to the''' Homepage,''' it will be''' front.''' | | If we want to link it to the''' Homepage,''' it will be''' front.''' | ||
− | But we want''' /forum''' here | + | But we want''' /forum''' here which is a link to the''' Forum.''' |
|- | |- | ||
| 11:08 | | 11:08 | ||
− | | Click''' Save''' and now we have a | + | | Click''' Save''' and now we have a link to the''' Forum'''. |
|- | |- | ||
Line 349: | Line 350: | ||
|- | |- | ||
| 11:21 | | 11:21 | ||
− | | So play around a little bit | + | | So, play around a little bit to understand it better. |
With this in our''' menu system,''' it will be easier to create''' Menu item''' for a''' View''' or a''' Content Type.''' | With this in our''' menu system,''' it will be easier to create''' Menu item''' for a''' View''' or a''' Content Type.''' | ||
|- | |- | ||
| 11:34 | | 11:34 | ||
− | | With this we come to the end of this tutorial. | + | | With this, we come to the end of this tutorial. |
|- | |- | ||
| 11:38 | | 11:38 | ||
− | | Let us summarize.In this tutorial we learnt | + | | Let us summarize.In this tutorial, we learnt about: |
+ | * Setting up '''URL Patterns''' | ||
+ | * '''Menu management'''. | ||
|- | |- | ||
| 11:59 | | 11:59 | ||
− | | 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'''. |
|- | |- | ||
| 12:09 | | 12:09 | ||
− | | The video at this link | + | | The video at this link summarizes the Spoken Tutorial project. Please download and watch it. |
|- | |- | ||
| 12:17 | | 12:17 | ||
− | | | + | | The Spoken Tutorial Project Team conducts workshops and gives certificates. For more details, please write to us. |
|- | |- | ||
| 12:26 | | 12:26 | ||
− | | Spoken Tutorial Project is funded byNMEICT, Ministry of Human Resource Development and NVLI, Ministry of Culture Government of India. | + | | Spoken Tutorial Project is funded byNMEICT, Ministry of Human Resource Development and NVLI, Ministry of Culture, Government of India. |
|- | |- | ||
| 12:39 | | 12:39 | ||
− | |This is Calvin Nikhil Tomy signing off.Thanks for joining. | + | |This is Calvin Nikhil Tomy, signing off. Thanks for joining. |
|} | |} |
Revision as of 16:48, 2 September 2016
Time | Narration |
00:01 | Welcome to the Spoken tutorial on Menu and Endpoints. |
00:06 | In this tutorial, we will learn to set up URL Patterns. We will also learn about Menu management. |
00:15 | To record this tutorial, I am using
You can use any web browser as per your choice. |
00:29 | In this tutorial, we will talk about the process of creating proper URL paths for our website. |
00:36 | Endpoints and aliases- Endpoints are URL paths which display a particular content. |
00:45 | By default, in Drupal, the endpoint of a node is node/[node:id]. |
00:53 | Sending this to a server will display the contents of the node. A number in the ID is not human readable. |
01:02 | That is, we cannot easily associate a particular content with say, node/278162
A human readable endpoint is available by creating an alias. |
01:19 | Alias is an alternate URL path for the same content. We can use either the original or any one of several aliases, for displaying the same content. |
01:34 | For example, node/278162 and content/drupal-camp-mumbai-2015. |
01:47 | Both return the same content. The second one is easy to remember. |
01:54 | Let us now create URL patterns that will apply to all the contents we have. |
01:59 | Setting up URL paths require three modules. |
02:04 | Those three modules are the Pathauto, Token and CTools. |
02:13 | Please go ahead and get the Pathauto installed on your machine. |
02:18 | Come back to the Pathauto project page. Here, you will notice that Pathauto requires Token and CTools. |
02:27 | Install Token and CTools. Once you have installed these modules, turn them on. |
02:37 | Once we have done that, we are ready to go. |
02:40 | Click on Configuration. Down here, on the left hand side, under the SEARCH AND METADATA section, you will see URL aliases. |
02:52 | By default, there are no URL aliases available. |
02:58 | Click on the Patterns tab. Click on the Add Pathauto pattern button. |
03:05 | Click on the Pattern type drop down. |
03:09 | Here we can create separate patterns for Forum, Content, Taxonomy term and User. |
03:17 | For example, I will select Content.
In the Path pattern field, we have to provide the pattern template. |
03:27 | Template variables are called as tokens. They are dynamically generated for each entity. |
03:36 | Token module provides these variables. When you see Browse available tokens in any input form, you can insert pre-defined tokens. |
03:49 | Click on the Path pattern box where you want to insert a token. |
03:55 | Type "content/". Then click on the Browse available tokens link. |
04:02 | A popup window opens up to show the "Available tokens". |
04:07 | Suppose we want a pattern like content/[title of the page], the token for the title of the page is under the Nodes section. |
04:18 | Click on the right arrow button of the Nodes section. |
04:23 | Choose the token [node:title] which will be replaced by the Title of the page. |
04:32 | This will insert [node:title] at the cursor location in the form box. |
04:38 | If this does not happen, make sure to click on the box and position the cursor as required.
Then select the token again. |
04:49 | Under Content type, we can select to which entity type this pattern should be applied. |
04:56 | Let us select all the types so that this pattern is default for all of them. |
05:04 | This setting can also be overridden for a particular type.
Example: we can create usergroup/[node:title] and apply it only for User Group. |
05:18 | In the Label field, type "Content Title". Then click on the Save button. Here, we can check the new pattern we just created. |
05:31 | This pattern will be applied to generate URL aliases for all newly added contents. But it will not create the URL aliases for existing contents. |
05:45 | To apply it for the existing contents, click on the Bulk generate tab. Select Content type and click on the Update button. |
05:58 | It is started generating the URL aliases. It can take a while depending on the number of existing contents. |
06:08 | Now click on the List tab. We can see that the URL aliases for our content. |
06:15 | Each node on our site has a system path of /node/nodeid. |
06:24 | The newly generated URL alias is there in the first Alias column. |
06:30 | We can see that all the aliases follow the same pattern. You have to do this each time you create a new Content type. |
06:41 | Use the following thumb rules to create patterns.
|
06:52 | * Separate words by hyphen and not underscore
|
07:07 | * Use date tokens for contents classified by time. |
07:12 | There are more options available to control the URL alias pattern in the Settings tab.
Here we can see default Separator, length etc. |
07:26 | We also see that, by default, several common words are removed from the pattern.
This is to keep the endpoint compact and meaningful. |
07:38 | To summarize -
Pathauto and Token modules allow us to
|
07:46 | * delete aliases and * bulk generate aliases at any time. |
07:52 | From now onwards, every new node will use the patterns that we have established. |
07:59 | Now, we will talk about the Menus. |
08:03 | We have been adding menus to our site, in a random order, mostly based on the Views and basic pages. |
08:10 | Now, let’s see how we can manage the menu system. |
08:15 | Go to Structure, scroll down and click on Menus. |
08:21 | We have a number of different menus here that come with Drupal, by default.
We have six menus, to be exact. |
08:31 | We are interested in the Main navigation menu. So, click on Edit menu. |
08:38 | Here, we will be able to click and drag and re-order our Menu links. |
08:44 | Let’s drag Home and Upcoming Events to the top. |
08:49 | You can re-order these, in any way you want. Once done, click Save. |
08:56 | Now we have got Events and Upcoming Events.
Let’s click and drag Events to the top and then drag Upcoming Events to the right. |
09:07 | This will create a sub menu. |
09:10 | That’s pretty simple. Click Save and take a look at our front page. |
09:15 | Notice that now we have got four menus. |
09:19 | Where did our Event sub menu go? |
09:23 | Please remember, not all themes in Drupal support sub menus or drop-down menus. 'Bartick theme is one of them. |
09:32 | For now, go back to Structure, Menus and edit the Main menu.
Drag Upcoming Event back over here and click Save. |
09:44 | What if we need a link to a particular node or to a particular section of our site? |
09:51 | For instance, if I wanted a menu link for my Forums, I would first go back to the site. |
09:58 | Go to the Forums page and copy the actual URL which is just /forum. |
10:05 | Then come back over and click on Edit menu and then on Add link. |
10:12 | Give it a title called Forum and paste the copied link. |
10:17 | If you are looking at a specific piece of content, just type a letter like ' F' or 'G'.
All the nodes that start with that letter, will show up. |
10:28 | Say, for instance, if we type an 'a' , all the nodes that have 'a' in the title, will show up. |
10:38 | We can just select the one we are looking for and it will tell us that its node id number 1. |
10:46 | If we want an internal path, such as the ability to add a node, then it would be /node/add. |
10:56 | If we want to link it to the Homepage, it will be front.
But we want /forum here which is a link to the Forum. |
11:08 | Click Save and now we have a link to the Forum. |
11:14 | Click Save. Let’s just double check if that works and indeed it does. |
11:21 | So, play around a little bit to understand it better.
With this in our menu system, it will be easier to create Menu item for a View or a Content Type. |
11:34 | With this, we come to the end of this tutorial. |
11:38 | Let us summarize.In this tutorial, we learnt about:
|
11:59 | This video is adapted from Acquia and OSTraining and revised by Spoken Tutorial Project, IIT Bombay. |
12:09 | The video at this link summarizes the Spoken Tutorial project. Please download and watch it. |
12:17 | The Spoken Tutorial Project Team conducts workshops and gives certificates. For more details, please write to us. |
12:26 | Spoken Tutorial Project is funded byNMEICT, Ministry of Human Resource Development and NVLI, Ministry of Culture, Government of India. |
12:39 | This is Calvin Nikhil Tomy, signing off. Thanks for joining. |