Skip to main content

Adding icon and type elements to the JSON output for React frontend

Working on a decoupled React / Drupal 9 site.

Aim: Adjust the output of curated content for the Work Resources page.  So the icon is displayed with a path.  Enabling React developers to select whether to use the image or icon.

Tools

Drupal 9.4
React  

 

Recently viewed pages

This code is from Drupal 9 back-end for a React front-end via REST API.

Working through the output for recently viewed pages... the code structure:

Subscribe to React