1

I've got a blog set up on my site, with a separate page holding all the blog posts. I've created a custom content type for making the individual blog posts so when a new post is created a preview is displayed in a list under a 'view', like any normal blog.

I would like to know how can I also list the blog previews (or teasers) on the home page as well as the main blog page?

1

I would like to know how can I also list the blog previews (or teasers) on the home page

You can do this using views in both D7 & D8. If you go at Structures/Views, you will find the view name Front page, you can enable that view which by default works as front page in Drupal. So as per you need, you just need to apply filter for blog content type and in view mode you can set it as teasers.

as well as the main blog page?

Same way you can make new view and give new path/url to that view and set it as main blog page.

Illustrations of above details:

1. Default front page view at Structures/views

enter image description here

2. Front page view setting page: I have changes the filter parameters so it will show only blog posts at home-page.

enter image description here

3. Output image: HOME page showing only blog previews.

enter image description here

  • There doesn't apear to be a view by the name of 'front page' could I create a custom one instead? – Whirlwind991 Oct 10 '16 at 5:05
  • @Whirlwind991 Not possible. If you are using D7, then did you downloaded views module and enabled it. In D8 views module it is by default so you do not need to download. I am posting screen-shot of both D7 and D8. Dy default Front-page view is not enabled, it appear as faced as shown in D7 Archive view in image. – CodeNext Oct 10 '16 at 5:52
  • I'm running D7. Well I went to download views module early on but drupal stated its already installed, though I couldn't find it listed in the module section. The Structure > Views panel is available though, it just doesn't contain a Frontpage view? I'm using a custom theme, maybe that has something to do with it? I'll come back and have another look at it tomorrow and let you know how I go. Thanks for your help though! – Whirlwind991 Oct 10 '16 at 6:01
  • No no no, it does have to do anything with theme. Go to modules and make sure Views and Views_UI these two modules are enabled. If those two are enabled, your views must show front page view. – CodeNext Oct 10 '16 at 6:03
  • Got it working, what I did in the end was assign the view to a block which gave me flexibility to place the block on whatever additional page I wanted. Your method would have worked just as well though so I will upvote, thanks for the support! – Whirlwind991 Oct 10 '16 at 23:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.