npCoda
npCoda

Reputation: 13

Meaning of Term Reference in Drupal

I am learning Drupal. I saw youtube videos which teach Drupal. I frequently hear the word Term Reference while learning it.

I google out and searched reference link but could not get clear concept of it.

So can you please briefly explain

what is the Term Reference and why to use?

Upvotes: 0

Views: 220

Answers (1)

xangy
xangy

Reputation: 1205

tl;dr Read blockquote for basic understanding, rest is examples to clear your thoughts.

In drupal, taxonomies(terms and vocabularies) are a type of entity like nodes, users. And reference fields are used to refer these entities in another entities.

So, a term reference field will be used to refer a term. So if I place a term reference field in a content type, then I can successfully access terms(related to term reference field) in nodes.

These terms are used to organize contents. Please refer this for more info: https://www.drupal.org/documentation/modules/taxonomy.

A good example of organizing contents will be in E-Commerce sites. For example: All the products(nodes) can be organized into Shirts, Pants, Shoes etc. using term references(shirt, pant, shoes respectively). And then I can use this field to fetch only shirt products or shoes products.

In vanilla drupal, tags is a reference field used in Article content type. When you create many articles tagging them to some terms like first. Then you can fetch all the article with term first.

Upvotes: 1

Related Questions