In the previous parts, we explored how to set up content types, configure fields, and structure your layout. Now, it’s time to bring your site design to life with a responsive Bootstrap grid powered by Drupal Views — and enhance it further by displaying related content dynamically.
Whether you’re creating a blog, portfolio, or product listing, this guide will help you structure and style your content with a professional, mobile-friendly layout.
What You’ll Learn in This Tutorial
In this post, we’ll cover:
How to create a responsive Bootstrap grid layout using Drupal Views.
How to filter and display related content automatically.
How to customize your grid layout with CSS classes and Bootstrap columns.
Tips for maintaining a clean, scalable structure for future site growth.
Step 1: Set Up a New View
Navigate to Structure → Views → Add new view.
Give your view a name, such as "Articles Grid" or "Portfolio Grid".
Choose the content type you want to display (e.g., Article or Product).
Set the display format to Grid and choose Bootstrap Grid (if your theme supports Bootstrap).
Click Save and Edit to customize your view.
Step 2: Configure Bootstrap Grid Settings
Once your view is created:
Under Format, click Settings.
Select the number of columns (e.g., 3 for desktops, 2 for tablets, 1 for mobile).
Add responsive classes such as:
Enable “Use custom CSS classes” to add styling flexibility.
✅ Pro Tip: Make sure your theme includes Bootstrap CSS. If not, add it manually or use the Bootstrap Barrio theme for full integration.
Step 3: Add Fields to Your Grid
Now, choose which fields to display in each grid item:
Image field – for the featured image or thumbnail.
Title field – clickable link to the content.
Body summary – a short description.
Category / Tags – for classification or filtering.
You can reorder fields or wrap them inside custom HTML to match your layout design.
Example field markup (in Rewrite results → Custom text):
Step 4: Display Related Content
To make your grid more dynamic, you can display related content automatically — for example, showing posts from the same category or tag.
Option 1: Use Contextual Filters
In the view settings, go to Advanced → Contextual Filters → Add.
Select the taxonomy term (e.g., Category: Term ID).
Set the filter to use the term ID from the URL.
Configure the fallback option to show all content if no term is provided.
This method ensures that when you visit a category page, the grid shows only related articles in that category.
Option 2: Use Relationships
If your content type references another entity (like “Author” or “Product Type”), you can add a relationship in Views:
Under Advanced → Relationships → Add, select your reference field.
Use the relationship to pull in related items from that field.
This helps you display content that shares the same author, category, or reference.
Step 5: Style the Grid with CSS
Now that your grid is working, refine its look with CSS. Example styling:
This will give your grid a modern, card-based design consistent with Bootstrap UI aesthetics.
Step 6: Test Responsiveness
Check your layout on multiple devices:
Desktop: 3–4 columns
Tablet: 2 columns
Mobile: 1 column
Adjust grid settings or CSS breakpoints as needed. You can preview using Chrome DevTools or Drupal’s responsive preview.
Bonus Tip: Use Blocks or Page Displays
You can create:
A Block view to insert the grid in your sidebar or homepage.
A Page view with a dedicated path like
/portfolio-gridor/articles-grid.
This gives you full flexibility to reuse your grid design across different pages.
Final Thoughts
By combining Drupal Views with Bootstrap grids, you can design powerful, responsive layouts that make your content look structured and professional.
Adding related content enhances user engagement, keeps visitors exploring your site, and improves SEO through better internal linking.
This approach blends visual consistency with data-driven automation, perfect for modern Drupal websites
✅ Quick Summary
| Step | Action | Goal |
|---|---|---|
| 1 | Create a new View | Display grid-based content |
| 2 | Enable Bootstrap format | Make it responsive |
| 3 | Add fields | Customize display |
| 4 | Use filters or relationships | Show related content |
| 5 | Add CSS | Improve visual design |