Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Drupal Js Path

Security covered Maintenance fixes only 1 sites

This module allows developers to easily access Drupal route aliases and internal paths within JavaScript. This avoids the need to manually update URLs in JavaScript files when route configurations change, simplifying AJAX and other URL-dependent functionality.

CONTENTS OF THIS FILE
---------------------

* Introduction
* Installation
* Usage
* Maintainers

INTRODUCTION
------------

This module will help the developers to use the route options in Javascript.
If we are using ajax or any URL related functionalities we are either rendering through
drupalSettings or we are using direct URL. Now if we change the URL we need to update
it in JS files to reflect the updated URL.

Instead if we can use this module it will provide 2 functions to get the alias or the internalPath
of the route provided. So we don't require any additional settings to fetch the URL even
if it is changed.

* For a full description of the module, visit the project page:
https://www.drupal.org/project/drupal_js_path

* To submit bug reports and feature suggestions, or to track changes:
https://www.drupal.org/project/issues/search/drupal_js_path

INSTALLATION
------------

* Install as you would normally install a contributed Drupal module.
See https://www.drupal.org/node/895232 for further information.

* By Using composer, composer require "drupal/drupal_js_path"

USAGE
-----------
Below are the 2 functions which are available to utilize in JS.
Drupal.alias(routeName, routeParams, routeOptions);
Drupal.path(routeName, routeParams, routeOptions);

MAINTAINERS
-----------

Current maintainers:
* Praveen Achanta (praveen3555) - https://www.drupal.org/u/praveen3555

Drupal 8–11

Ask your assistant about Drupal Js Path

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
5
Tracked since
Jul 2023
Latest release
3 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
2.0.0 Stable 8–11 Jul 12, 2026
1.0.3 Stable 8–11 Nov 14, 2025
1.0.2 Stable 8–10 Jul 26, 2023
1.0.1 Stable 8–10 Jul 1, 2023
1.0.0 Stable 8–10 Jul 1, 2023