Skip to main content
Drupal SiteBuilder

Main navigation

  • Home
User account menu
  • Log in

Breadcrumb

  1. Home

Why are lists to "Taxing"

Gerald and Spike
Why do it this way?

Gerald has had a rough few chapters.

The Christmas cards. The notes field. The nephew. Gerald has sat quietly through a lot of uncomfortable revelations about his data habits and he has taken it well, all things considered. It is time for Gerald to get a win.

Gerald has a lot of family photos. Decades of them. Birthdays, holidays, Boy Scout events, family reunions, the annual barbecue where Gerald always looks slightly confused. He has been meaning to organize them properly for years. His wife has been meaning to organize them differently for the same number of years. This has been a source of quiet tension in the Gerald household.

Gerald just found out his Drupal site can be the family photo album.

Gerald is very excited. His wife has questions.

Gerald's wife wants to describe every photo. Not just tag it — describe it. "Kids having fun at the lake." "Spike and his friends at the campfire." "Gerald looking confused at the barbecue again." These are good descriptions. They are warm and human and exactly the kind of thing you want to remember about a photo.

They belong in the caption field.

The activity field is for something else entirely.

The activity field doesn't want a sentence. It wants you to pick from a list. Boy Scout Event. Family Reunion. Birthday Party. Christmas Morning. Annual Barbecue. The list is yours — you build it, you name the items, you add new ones whenever you need them. It lives in Drupal and it is always there waiting when you upload a photo.

Drupal calls this list a vocabulary. It calls the items on it terms. You will not be tested on this. Just know that when someone says taxonomy they mean the list, and when they say term they mean an item on it. Taxonomy is just the name Drupal gives to the whole system of lists. It sounds like a biology class. It isn't.

The caption is where Gerald's wife gets to write the story. The activity field is where she picks from the list. Both things are true. They just live in different fields. This is actually the resolution of a marital disagreement that has been running for longer than either of them realized, and Drupal solved it without being asked.

Now here is the part nobody expects.

A term is not just a label. It is not a sticky note on the photo. It is a record — the same kind of record as everything else in Drupal. It has its own page. It has fields. "Boy Scout Event" can have a description, a date range, a note about which troop was involved. Every photo connected to that term inherits that relationship. You didn't just tag a photo with a word. You connected it to something that knows things.

You probably won't need to think about this very often. Most of the time a term is just a term — a tidy item on a list that keeps your data clean and queryable. But the capability is there when you need it. The list is smarter than it looks.

Gerald has a son named Spike.

Of course he does.

Gerald's photo site has three vocabularies. People — every family member who appears in photos, Spike included. Locations — every place photos were taken. Johnson Lake. The backyard. Grandma's house. The scout camp on the ridge. Activities — every kind of event worth remembering.

Every time a photo is uploaded, someone picks from the three lists. Who is in it. Where it was taken. What was happening. Three fields. Three picks. Thirty seconds.

That is the whole job.

Six months later Gerald's son comes home for Thanksgiving. Spike is grown now, or getting there, and he sits down at the family computer and asks his father to show him the Boy Scout photos.

Gerald opens a View.

Give me every photo tagged Boy Scout Event. Done — there they are, every one, in chronological order, from the first campout to the last badge ceremony. Gerald didn't build that slideshow. He just tagged the photos correctly every time he uploaded one. Views found them. The terms did the work.

Spike leans forward. Can you show just the ones at Johnson Lake?

Gerald adds a filter. Activities: Boy Scout Event. Location: Johnson Lake. The slideshow gets shorter and more specific. There is the lake. There is the dock. There is Spike at eleven years old squinting into the sun.

Can you show just the ones where I'm in it?

Gerald adds one more filter. People: Spike.

Every photo of Spike at a Boy Scout event at Johnson Lake. Out of hundreds of photos, spanning decades, organized by three lists that Gerald's wife filled in carefully every time she uploaded a new one.

Nobody built that query when the site was designed. Nobody anticipated that Spike would ask that question on a Tuesday in November. The terms were just lists. The lists were just picks. The picks were just thirty seconds of careful data entry repeated over years.

Views found the answer. The taxonomy made it possible.

Taxonomy is just lists. Friendly, flexible, entirely yours to build however your content requires. The items on the list are smarter than they look. And when you combine them — people, places, activities, any vocabulary you need — your site can answer questions you haven't thought of yet.

Gerald's wife still writes stories in the caption field. Gerald has stopped trying to talk her out of it.

They were both right all along.

But taxonomy doesn't stop at the photo album.

Gerald's family also keeps recipes on the site. Mom's crab cakes. Grandma's pie. The barbecue sauce nobody is allowed to modify. Each recipe has a field called "Who Loves This" — and it draws from the same People vocabulary as the photo album. The same list. The same terms. The same Spike.

Mom opens the crab cake recipe and picks Spike from the list. She has done this for every recipe she has ever posted, because Mom knows exactly who loves what and she has opinions about it.

The People vocabulary has one more trick. Each term — each person — has an avatar field. A small photo. Spike's face. When Spike is tagged on a recipe, his face appears in the sidebar. Not because anyone built a "show Spike's face on recipes he loves" feature. Because the term is a record, the record has a field, and the field has a photo in it.

Now Views enters the picture one more time. The crab cake recipe page has a block at the bottom — photos tagged both with Spike and with Fourth of July. Nobody built a relationship between the recipe and the photo album. Nobody said "connect the crab cakes to the fourth of July." Mom uploaded a photo from last summer's cookout, tagged it with Spike, tagged it with Fourth of July, tagged it with the activity Cooking. Views found it. The taxonomy connected it.

The crab cake photo lives in the photo album and on the recipe page. It didn't move. It didn't get copied. It just got tagged correctly, once, and Drupal found every place it belonged.

That is what a taxonomy term can do when it is treated as a record and not just a label. It becomes the thread that runs through everything — recipes, photos, people, places, events — connecting content that was never explicitly linked, answering questions that were never explicitly asked.

Mom just picked from the list. Drupal did the rest.

How to do it:

Taxonomies are managed in Drupal at Structure → Taxonomy. Each vocabulary has a name, a machine name, and an optional description. Terms are added to vocabularies either through the taxonomy management interface or directly from the content editing form if the field is configured to allow it.

To attach a taxonomy to a content type, add an Entity Reference field pointing to the relevant vocabulary. Set it to allow a single term or multiple terms depending on your needs. The People field on a photo content type should allow multiple terms — Spike and his three friends can all be in the same photo.

Views uses taxonomy term references as filters. To build Gerald's slideshow, create a View of photo content, add filter criteria for each vocabulary field, and expose those filters to the user so they can narrow the results themselves. The compound query — Spike, Boy Scout Event, Johnson Lake — is three exposed filters and a handful of clicks.

Keep your vocabularies focused. A vocabulary called "Everything" is just a notes field with extra steps.

Chapter Weight
5

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