From the course: Drupal 9 Essential Training: 2 Content and Fields

Adding an article - Drupal Tutorial

From the course: Drupal 9 Essential Training: 2 Content and Fields

Start my 1-month free trial

Adding an article

- [Instructor] All right, now that we understand a little bit more about content types and structured data, let's go ahead and add another article. We'll make this one, the Welcome to Drupalville article. Hover over Content, Add content, and click on Article. Go ahead and put Welcome to Drupalville in for the title. Now, for the bulk of this course we're going to use Lorem Ipsum text in a body field like this. So you've got some options. Lipsom.com, baconipsum.com. There's even a vegetarianipsum.com. (chuckles) Whatever one you want to use go ahead and grab some lorem ipsum text. You might as well leave that tab open so you can come back and get some more, or copy and paste some text into a text file that you can just copy and paste back into Drupal. I'm going to paste that in. I'm going to add a couple of tags here. Welcome and Drupalville. Again, tags here are for categories. We'll talk more about that shortly. And go ahead and add an image. You can choose any image you want. I have a picture of my hometown from the air so I'm going to use that. But I'm going to call it Drupalville from the air. Again, alternate text is required. Now, over here on the right-hand side you're going to see the publication settings. We have a revision log message. I encourage you to always add log messages to your versions of your notes. Menu settings. We're not going to provide a menu link. Comments settings. By default article allow for comments. We'll leave that on for now. URL alias. Again, Drupal will always do that for you. I encourage you to let Drupal do its thing. Authoring information. And then finally, promotion options. Articles are promoted to the front page by default. We'll leave that the way it is. So again, note here in the article content type we have a title, body, tags, image and it's going to be promoted to the front page by default. Go ahead and click Save. And here's your Welcome to Drupalville article. This is a picture of my hometown from the air and I've got my text. The text wraps around the image in this case because that's what this particular theme will do. You'll note, I have a View tab, an Edit tab, Delete, and Revisions tab. When I'm an anonymous user or someone just visiting the site, of course these tabs are not visible. If I click on the Home button, you'll note that my two article nodes are listed on the homepage by publication date order in what's called a teaser display. The teaser display for the article content type includes the title, the submission information, a smaller version of the image which is created automatically. And we'll talk more about that. An production to the text, the tags, a read more, and add new comment link. Every time you add a new node of the article content type, if you don't uncheck that promote to the front page, well then these nodes will be on your front page until of course you do something different with your front page. Clicking on either of these tags is going to take me to a taxonomy term page. I.e. a group of nodes that have been tagged with that particular word. In this case, welcome. Any node that was sharing the welcome tag would appear here in a similar way it appears on the homepage. So that's the article content type. It has specific fields and a specific purpose on your site.

Contents