How To Insert Node Reference in Content Using Views

| Drupal Development | 25 seen

I this article I'll cover some details on how to programmatically reference nodes in content using Drupal views.

Such behavior I've already implemented in this blog, see for example 83 reasons to Visit Georgia This year article to see it in action. Today I was working on one of my side projects - a laptop buying guide - laptop500.com and decided to implement a new feature - best selling items of the month, by programmatically referencing laptops (nodes) from archive.

Here is how - at start you will need to download and install references module, then visit Content type you would like to add such behavior and under manage fields (admin/structure/types/manage/article/fields) add a new Node Reference field

Node Reference field

Node Reference field

I will set widget to Auto complete text field as later it will be much easier to enter just first letters of title to find and reference nodes.

In the next window (Field Settings) select Content types that can be referenced, articles for example

In the next window, under REFERENCED ITEMS FIELD SETTINGS Number of Values, make sure you select unlimited

Next go and create a new article to whom you just add a new node reference field, you should see new field enabled and you could start referencing nodes

Referencing nodes in Drupal

Referencing nodes in Drupal

Now, after you will save your content all referenced items will be listed unformatted under content area, you could leave this as it is, or you could use manage display section from content type and hide referenced item field, and instead build a new views block to style those items

Referenced items under content

Referenced items under content

I'm going to hide default display and build a new views block. 

Create a new view, add Contextual filter nid, and add Relationships - referenced nodes, then add your fields and make them related to relationship, then just put block in your content area. 

Node reference views display using relationships

Referenced nodes displayed as views block

Referenced nodes displayed as views block

See live demo here: Top 20 Best Selling Laptop / Notebook Computers in April 2017

 

Latest articles

Embedded thumbnail for Mumbai & Goa / India Trip

Mumbai & Goa / India Trip

It has already become something of a tradition for us - escaping the cold during our daughter’s winter school break and trading grey skies for warmth, color, and a slower rhythm of life. Each year, we carve out about three weeks to leave Tbilisi behind and head somewhere sunnier. And more often than not, that “somewhere” turns out to be India.Our…

India |

RWA Tokenization in Georgia: Key Takeaways from DGFI & Forbes Conference in Tbilisi

On April 24, 2026, DGFI, in collaboration with Forbes Georgia, hosted a conference on Real-World Asset (RWA) tokenization at the Radisson Blu Iveria Hotel in Tbilisi. The event brought together representatives from financial institutions, regulators, brokerage houses, and emerging fintech players to discuss the evolving landscape of tokenized…

Living in Georgia |