Development

Testing Tokens with Entity Ref Traversal via Drush

I am working on a project that has some complicated depth. I needed a way to quickly test token replacement. It’s pretty simple when you understand a few things.

Example Architecture

Here’s the Drupal architecture for this example:

  • Discussion Group (content type)
    • Title
    • Intro
    • Body
    • “Associated Experts” paragraph field (allows one “Associated Experts” paragraph item)
  • Associated Experts (paragraph type, used by many content types like Discussion Group above)
    • Heading
    • Intro
    • Experts (allows unlimited number of “Expert” nodes)
  • Expert (content type)
    • Title
    • Photo

So, the structure of a node looks like this:

  • Discussion Group node
    • Title
    • Body
    • Associated Experts
      • Associated Expert 0 (there is only one)
        • Heading
        • Intro
        • Experts¬†(there may be many)
          • Expert 0
            • Title
            • Photo
          • Expert 1
            • Title
            • Photo
          • etc…

Leave a Reply

Your email address will not be published. Required fields are marked *