Create a deep redirect in a headless site

One of our clients has a custom surveying application built with a Drupal back end, and a VueJS/headless front end. They use this application to record observations in various buildings and sites that don't meet accessibility requirements.

They give their clients access to the front end. This application organizes observations into particular sites, in particular projects, grouped by the requirement. Each observation can have photos attached, along with notes and recommended solutions.

Once the surveyors have completed their assessment, the back end Drupal site generates a PDF report that often exceeds 100 pages. Each observation is linked back into the application, essentially a link to the ID of the observation in the Drupal system. But to make the front end load quicker, we wanted to pass the IDs for the project and site along with the observation, so the front end loads everything up right away.

This Events, Conditions, and Actions (ECA) model intercepts requests to a particular observation, and rewrites the URL to include the specific UUIDs for the building, project, and area, and then redirects into the fully-loaded front end path! This made it easy to implement the Drupal side with nothing special or unusual for Drupal, while passing in a bunch of context to the Vue Router, which could then request and load all the corresponding data in a very straightforward way.

Advent 2024 -- 24 days of Automations

Door number 7
7
Door number 10
10
Door number 14
14
Door number 19
19
Door number 6
6
Door number 17
17
Door number 1
1
Door number 4
4
Door number 16
16
Door number 22
22
Door number 3
3
Door number 21
21
Door number 5
5
Door number 2
2
Door number 11
11
Door number 9
9
Door number 15
15
Door number 12
12
Door number 8
8
Door number 13
13
Door number 18
18
Door number 20
20
Door number 23
23
Door number 24
24

Add new comment

The content of this field is kept private and will not be shown publicly.

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <blockquote cite> <cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h1> <h2 id> <h3 id> <h4 id> <h5 id> <p> <br> <img src alt height width>
  • Lines and paragraphs break automatically.