Problem/Motivation

As a frontend developer I want to be able to resolve all types of routes from Drupal, not just entity routes.

Steps to reproduce

1. Setup a site with Druxt / Decoupled Router
2. Access /router/translate-path?path=/user/login

Proposed resolution

Make a fallback/wildcard/catchall path translator service that returns data pertaining to the route.

{
  resolved: "https://8080-realityloop-starterkitd-tqhtzkxmv10.ws-us70.gitpod.io/user/login",
  isHomePath: true,
  label: "Log in",
  context: {
    _form: "\Drupal\user\Form\UserLoginForm",
    _title: "Log in",
    _route: "user.login",
    _route_object: { },
    _raw_variables: { },
    _controller: "controller.form:getContentResult"
  }
}

Remaining tasks

Create a WildcardPathTranslatorSubscriber service that provides the $match_info object as context for a frontend client to consume as required.

User interface changes

N/A

API changes

Add context attribute to results.

Data model changes

Add context attribute to results.

Issue fork druxt-3315030

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Deciphered created an issue. See original summary.

deciphered’s picture

Issue summary: View changes

deciphered’s picture

Status: Active » Needs review

realityloop made their first commit to this issue’s fork.

realityloop’s picture

realityloop’s picture

Version: 1.1.x-dev » 1.2.x-dev

realityloop’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.