Skip to main content
Drupal SiteBuilder

Main navigation

  • Home
User account menu
  • Log in

Breadcrumb

  1. Home

What can you see in the View?

Gerald and Fred
Why do it this way?

HR stopped by this morning.

The county added a library expense reimbursement program for the parents of students who live in Chesterfield County. The company wants to cover it for employees that live in  Chesterfield County. HR needs a list of employees with dependent children in primary school who live in Chesterfield County. By Friday.

Your site builder is at lunch. He is most of the way through a very good hamburger and he does not know about any of this yet.

Here is the question: when he gets back, is the answer thirty seconds away or three weeks away?

The answer depends entirely on a conversation that happened long before today. A conversation about fields.

You have content. Lots of it. Properly structured, carefully maintained, sitting in the database being exactly what it is — employee records with named fields, typed data, defined relationships. Name. Department. Start date. Dependents. Each dependent has a name, a birth date, a residential address. Someone typed all of that in, field by field, at some point in the past, for reasons that had nothing to do with library reimbursements.

That data has been sitting there quietly ever since, waiting to be useful in ways nobody anticipated.

Views is how you ask it a question.

Remember the separation. The node is the data. The page Drupal shows you when you visit an employee record is just the default way of looking at that data — one row, all columns, formatted for a human reader. It is useful. It is not the only way.

Views is other way.

A View is a question you ask of your content. Show me all the employees. Now filter by county of residence — Chesterfield County only. Now filter by dependents whose age would put them in primary school. Now show me just the employee name, department, and the dependent's name. Format it as a table. Add an export button so HR can take it to Excel.

The site builder finishes his hamburger. He builds the View. HR has their list before end of day.

The content didn't change. The records didn't change. The site builder just asked a question the data was already prepared to answer.

Gerald would like a word.

Gerald, you will recall, wants to send Christmas cards to his size 12 customers. He cannot, because shoe size lives in a notes field with everything else, and a notes field cannot be filtered, sorted, or queried. It can only be read. Gerald's data exists. It is simply not structured data, which means it cannot answer questions. It can only be stared at.

But imagine Gerald had done it properly. Imagine each customer record had a shoe size field — a real field, with a defined value — and a birthday field, and an email field, and a preferred style field. Imagine Gerald had taken the time, years ago, to define his columns before he started adding rows.

Gerald could have a calendar. Not just a Christmas card list — a calendar. Every customer's birthday, sorted by shoe size, so Gerald knows that three size 12 customers have birthdays in the first week of December and maybe that is a good moment to call. Gerald did not build that calendar. He just kept good records. Views built the calendar. Gerald asked the question.

This is what structured data does over time. It compounds. Every field you define correctly today is a question you can answer tomorrow — a question you may not even know you will need to ask yet. The HR library list was not on anyone's mind when the employee records were designed. The Chesterfield County field existed because someone thought it might matter for tax purposes. It mattered for something nobody anticipated, on a Friday morning, when the site builder was two bites into his lunch.

Views is not magic. This is important to understand.

Views can only work with what exists. It cannot find shoe size in a notes field. It cannot sort by a date that was never captured. It cannot filter by a county that was never recorded. It cannot produce a list of primary school dependents if nobody ever defined what a dependent is or when they were born.

The power of Views is entirely dependent on the quality of the thinking that happened before anyone opened Drupal. The content type design. The field definitions. The decision to make shoe size a field instead of a sentence. That conversation — the one at the whiteboard, or the coffee shop, or the back of a napkin — is the conversation that determines whether HR waits thirty seconds or three weeks.

Views is the proof that the separation between data and display is not just a philosophical distinction. It is a practical superpower. But only if the data was structured correctly in the first place.

The site builder finished his hamburger. HR got their list.

Gerald is still addressing envelopes by hand.

How to do it:

Views is enabled by default in Drupal core. You can access it at Structure → Views. Drupal ships with several default Views already configured — the content administration page, the user list, the taxonomy term pages. These are useful starting points and good examples of what Views can do.

To create a new View, go to Structure → Views → Add View. Give it a name, choose what type of content to display, and define your filters, sort criteria, and display format. Views offers multiple display types — page, block, REST export, attachment — each of which can be configured independently while drawing from the same underlying query.

The learning curve is real but the logic is consistent. Every View is a question. Define what you are asking, define what you want to see, define how you want to see it. The rest is configuration.

For the HR list, the export to Excel is handled by the Views Data Export module — a contributed module that adds a file export display type to any View. Install it, add a new display to your View, configure the fields, and HR has a download button. The site builder can finish his coffee too.

Chapter Weight
4

content list

Nobody Needs a Website
Gerald and Fred
Editor, Management, Site Builder

Six Different Jobs
Gerald and Fred
Editor, Management, Site Builder

Everything is a node
Gerald and Fred
Site Builder

What is a Content Type
Gerald and Fred
Management, Site Builder

What can you see in the View?
Gerald and Fred
Management, Site Builder

Why are lists to "Taxing"
Gerald and Spike
Management, Site Builder

Having a picnic with Fields
Gerald and Fred
Editor, Site Builder

He was hit by a beer truck.
Hit by a Beer Truck
Management

Who needs this site
Janet and Thomas
Management, Site Builder

You Need Your Own Box
Gerald and Fred
Site Builder

You Need Your Own Box
Gerald and Fred
Management

What To Buy
Gerald and Fred
Site Builder

Using an AI assistant
an assistant
Site Builder

Using an AI assistant
an assistant
Management

Getting Ubuntu onto a USB Drive
Fred and Thomas
Site Builder

Installing Ubuntu on Your Dev Box
Gerald and Fred
Site Builder

Connecting to Your Dev Box with Bitvise
Janet and Thomas
Site Builder

Giving Your Dev Box a Permanent Address
Gerald and Fred
Site Builder

Your First Linux Commands
Gerald and Janet
Site Builder

Powered by Drupal