Skip to content

Instantly share code, notes, and snippets.

@gwagroves
Created June 29, 2018 07:43
Show Gist options
  • Save gwagroves/fb63438a647a00bf882e3f5058aed98f to your computer and use it in GitHub Desktop.
Save gwagroves/fb63438a647a00bf882e3f5058aed98f to your computer and use it in GitHub Desktop.
Pathauto token for path from entity reference field

Content type event has an entity reference field containing a location.

We want the following URL structure:

# For the location
/location-title

# For the event
/location-title/event/event-title

Set the following pathauto pattern for the event:

/[node:field_location:entity:url:path]/events/[node:title]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment