Score:-3

Display all the nodes from a specific content type on the front page

cn flag

I have a custom content type (news). I want to show all those nodes on the front page.

How can I achieve this?

Kevin avatar
in flag
Use Views... plenty of docs on Views.
Score:0
de flag

As Kevin said in the comments, you could try using Views. In order for you to be able to create a new view for your content type, Views UI module should be enabled. After that, you can navigate to Admin/Structure/Views (/admin/structure/views), and create a new view.

On the new view creation page you should check under Views settings to show Content of type News, and on the next section, you can create a page for it with the path of /news for example. Then you can add your desired fields to show, with lots of other options like filtering and sorting. Here is the user guide on Drupal.org how to do this.

Once you have created the view, you can change your site configuration, to have the /news path as your default home page, if you only want to show the content from this view. (Configuration/System/Basic site settings - admin/config/system/site-information)

If you already have a front page, and you want to show the content of the news content type in a block, you can create a block view by either ticking the checkbox upon the views creation in the section 'Block settings', or by adding a new display on the view configuration page. This way, you would have a block you can place anywhere in your site, by navigating to Structure/Block layout /admin/structure/block and adding it to the desired region.

Hope this helps, please read the user guide above for further instructions.

Score:-1
cn flag

There is a simple way to show content on the front page.

Go to Admin -> Structure -> Content Types. (/admin/structure/types/manage/)

For your content type News, click Edit. (You may need to click the flippy triangle next to Manage fields to get the Edit option.)

Scroll down to Publishing options. Make sure Promoted to front page is checked.

Note: If you change your front page to something other than the default, this setting may not work depending on what you changed the front page to.

apaderno avatar
us flag
I didn't down-vote the answer, but I think it doesn't allow to show every _Article_ node on the front page, and show only those nodes. The question doesn't make clear if that is the case, though, so the answer cannot be said to be wrong. Actually, the question doesn't even say if the _Promoted to front page_ option in the node creation form should be taken in consideration.
apaderno avatar
us flag
To make my previous comment clear: This method works if the users who create the _Article_ node aren't allowed to change the _Promoted to front page_ option given when creating/editing a node. If more than a content type has _Promoted to front page_ enabled, the front page wouldn't show just _Article_ nodes.
sonfd avatar
in flag
I down voted this answer. In addition to the comments above, checking that box would only give future news the chance to appear on the front page, not anything created in the past. I also think the answer needs to explain why checking this checkbox would work rather than adding a disclaimer at the end saying it might not work.
cn flag
@sonfd Thanks, please comment when you downvote; it's helpful to the person who wrote the answer, and to people who may refer to the answer.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.