Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
The drupal_get_path_alias() function does a database lookup of a certain URL to see whether an equivalent alias exists and that's something you can't do using JavaScript.
What you can do instead is using jQuery to perform an $.get() call to a page which returns the result you require and use that.
Comments
I don't think that's possible
I don't think that's possible.
The drupal_get_path_alias() function does a database lookup of a certain URL to see whether an equivalent alias exists and that's something you can't do using JavaScript.
What you can do instead is using jQuery to perform an $.get() call to a page which returns the result you require and use that.
you can use Drupal.settings
You can use Drupal.settings.thisPage to get current path.
Thanks
Thank you for the help.
Paul K Egell-Johnsen
Paul K Egell-Johnsen