Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [path-aliases]

Use it for questions about path aliases, a way of creating pretty human readable URLs to replace system URLs like node/[nid].

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

in view path, can I replace tid with token:name

What I have, the view path bild the path with token id's. such like: excample.com/view?token=555 maybe with [node:field_token:entity:name] or {{ node:field_token:entity:name }} ? with ...
Hartmut Theis's user avatar
0 votes
0 answers
38 views

Can't make my custom dynamic route use custom controller and twig template if I use pathauto aliases

I'm trying to decouple drupal and get data via api calls so that I can use the same data across several drupal installs on different domains. So far I'm testing on the same domain but still can't ...
Andrei's user avatar
  • 15
3 votes
1 answer
60 views

How to delete duplicate path aliases?

Duplicate path aliases are seen as rows in the path_alias table with identical path and alias columns. Due to old bugs in pathauto and other reasons, like buggy custom code, it is possible to have ...
mona lisa's user avatar
  • 5,950
0 votes
1 answer
47 views

Multiple URL aliases on the same node/product

Create an alias for a node/product. /admin/config/search/path/add Create another alias pointing to the same node; /node/123 for example. The first alias created is now 301'd to the last one defined. ...
Wayne Foster's user avatar
0 votes
1 answer
165 views

How can I delete an existing path alias?

In Drupal 7, a path alias can be deleted with code similar to the following one. path_delete(array('source' => "problem/{$problem->nid}/{$problem_src->nid}")); How can I delete ...
user avatar
1 vote
1 answer
56 views

How do I parse a path alias? [closed]

I have the following code in my page.tpl.php file. <?php $path = drupal_get_path_alias($_GET['q']); ?> <?php if ($path == 'about-us'): ?> <div class="container"> <...
CJ Catalano's user avatar
0 votes
1 answer
412 views

How can I confirm a path is internal?

In my theme's theme file I'm using preprocess_node to create variables for a node based on the section of my site its in, and that's figured out by checking the path's alias. So for example a path ...
fallenturtle's user avatar
1 vote
0 answers
85 views

How to find PathAuto state?

I am trying to put together a list of content on the site that has the PathAuto setting still checked so it will update when the title of the page is changed. Can't seem to find where this would be ...
ThankYouNeco's user avatar
0 votes
1 answer
293 views

Url-aliases or redirect without language prefix

How can I use url-aliases in additional languages without the language prefix? From his old homebrew-CMS, my client has the following URLs: example.com/english-page => redirecting to example.com/...
mullzk's user avatar
  • 65
0 votes
1 answer
60 views

Option to export path alias not showing in view (pathauto is installed)

On my new D 9.5.x site, I have pathauto installed, and it is working well. That is, neat alias URLs get generated for my articles as expected. I am now trying to export articles from the site. I have ...
Chandra's user avatar
  • 11
0 votes
1 answer
109 views

How to make it so theme function isn't used when editing a node with layout builder

I have the following two functions in my .theme file that I'm using to gleam various bits of information from both the path alias and internal URL of the page being viewed. They are: function ...
fallenturtle's user avatar
0 votes
0 answers
65 views

Change all generated user/{uid} paths to user/{uuid} and process them without the redirect

I need to change all generated user/{uid} paths to user/{uuid} and process them without the redirect. The tricky part is that I need to: Output canonical URLs to user/{uuid} instead of user/{uid} ...
Alex Smirnoff's user avatar
1 vote
1 answer
149 views

path alias OK for default language, but no alias for others

My site is in D9, mainly in French, with some pages in English. I have an old page (note 553 written in D6 in 2017), which can be correctly accessed in French with https://mysite/myoldpage and in ...
Benoit's user avatar
  • 13
1 vote
0 answers
26 views

Why is my translated content loaded on a 'raw' node address even when there is an alias given? (Multilingual Site)

I have two languages (English and Spanish) in my Drupal site. The default language (English) content has already been created and now I need to translate the content (articles/pages/blocks) into ...
techenzie's user avatar
0 votes
1 answer
360 views

AliasManagerInterface -deprecated Drupal\Core\Path\AliasManagerInterface

Error: The website encountered an unexpected error. Please try again later. TypeError: Argument passed to Drupal{module name}\Theme{class name}::__construct() must implement interface Drupal\...
user avatar
3 votes
2 answers
268 views

How to use a token that includes slashes with PathAuto?

I have a custom token that gets the path value from a JSON field. The JSON field stores the path like this (in the database, the slashes are escaped, but I'm showing an unescaped example here): { &...
Patrick Kenny's user avatar
0 votes
1 answer
173 views

Custom alias for home page

I have a bilingual website (French and English) I have set "/fr/nom-de-page" as the home page in /fr/admin/config/system/site-information But Drupal 9.4.5 insist on redirecting to /fr/ I ...
MastaP's user avatar
  • 152
0 votes
1 answer
186 views

How to add menu item active class while using url aliases?

My active class name is not working for menu items that redirect to a node using URL aliases For example, if I have a node node/10 and its alias URL is movie/avengers, I'm not able to see the active ...
Lalas Muathasim's user avatar
1 vote
1 answer
624 views

Use path alias as contextual filter

I have nodes in Drupal for News Articles that generates this automatic URL alias. I also have a view for News nodes. This is the data. The problem is that I can't use Content: Path (url) or Content:...
Mathew Dony's user avatar
0 votes
1 answer
61 views

Retain sites/<site>/files path for cdn urls

I just updated the cdn module and seems the CDN urls formed for pdf (and other) attachments have been updated with the /public/ keyword. Before: https://cdn-domain/de/cdn/farfuture/<token_string>...
jitendrapurohit's user avatar
2 votes
0 answers
68 views

How can I provide language-aware URL patterns for Pathauto?

I am using this pattern in Drupal 9 Pathauto to generate URLs: [node:menu-link:parents:join-path]/[node:menu-link] This does however not seem to work when using translated content. The generated URL ...
Morten Najbjerg's user avatar
1 vote
1 answer
71 views

Problem with auto-generated url alias when attempting to make a third-level menu item

Using [node:menu-link:parents]/[node:title] as the pattern for nodes in Url Aliases works fine for a menu that is only two levels, but if I attempt to assign a node to a third level under a menu, ...
Pat Leonard's user avatar
0 votes
1 answer
107 views

Cannot set path alias to "/" [closed]

I have a weird use case where I need to specifically set the path alias of my home page to "/". I am creating a Gatsby site and the pages are auto generated based completely off of the ...
Erich H.'s user avatar
  • 355
0 votes
1 answer
112 views

Where are path aliases stored?

I know that, in Drupal 7, path aliases are stored in the url_alias table. Which database table does Drupal 8 use to store path aliases?
Richi RM's user avatar
  • 143
0 votes
1 answer
259 views

Changing a node alias to reuse his old url programmatically without be still redirected to the node page

I'm on a old site on drupal 7. I have a node with alias /url. Now I need to manage that page url programmatically, so I create an item in a custom module using hook_menu() in this way: /** * ...
robdex's user avatar
  • 11
3 votes
1 answer
3k views

How to check if path alias exists

In Drupal 8, my custom module includes the code if (\Drupal::service('path.alias_storage')->aliasExists($path, 'en')) { return true; } What should this look like in Drupal 9.2? Seems so simple,...
Marshall Morrise's user avatar
2 votes
0 answers
93 views

How to automatically generate two aliases for the same node? [closed]

I am working on a Drupal website. I need to automatically generate 2 url aliases for the same node on the website. I have tried installing Pathauto but it lets me generate only 1 alias when a new page ...
RitikaDesai's user avatar
0 votes
1 answer
166 views

How can I filter the path aliases by node id?

On this page admin/config/search/path, we can only filter the results by URL alias. I want to filter the results by node id as well? How can I do that? It is not possible with form alter. As the ...
Ahmad's user avatar
  • 2,835
2 votes
1 answer
226 views

How do I create multilingual user path aliases?

I'm setting up a multilingual site, and I need the user path aliases to be multilingual. Users are set up as translatable: Language Detection: URL (path prefix) English: /en Japanese: No prefix ...
Jaypan's user avatar
  • 17.6k
1 vote
0 answers
30 views

Generate same Path aliases for multi languages

I have a content type Products. A pattern is defined via the Pathauto module for product CT. but my issue is that when I translate an entry/node it generates a translated path alias for Urdu in Roman-...
Shakil Ahmad's user avatar
1 vote
0 answers
534 views

How do I programmatically create a path alias? [duplicate]

How do I programmatically create a path alias in Drupal 9? I'm creating node, but I also want to give the node a URL alias, but cannot figure out what class to use, PathAlias or AliasManager or ...?
JemoeE's user avatar
  • 163
2 votes
1 answer
67 views

Change priority of different aliases with the same aliases

There is vocabulary, let's call it forum tags which contain all forum tags, Also, in Forum, the link for the Forum container using a similar tag pattern for the forums. for example, Term name : ...
Yuseferi's user avatar
  • 22k
0 votes
1 answer
2k views

Update Alias Programmatically

I have a large website with 240 urls that need to be updated. I would like to do this programmatically to avoid making errors. I created the following function which seems to work. There seems to ...
Greg Sims's user avatar
  • 573
0 votes
0 answers
107 views

Using Drush 10 and sql-sync with path based sites not working

We have two websites running off a single domain: https://www.mywebsite.com https://www.mywebsite.com/mywebsitetools Both websites have their own databases and are hosted by Acquia. We've been using ...
codewrangler's user avatar
1 vote
1 answer
790 views

How to create automatic url alias for taxonomy/term/%tid/feed

How can I set automatic URL aliases for taxonomy feeds? Say I have a term with tid=1, named holidays, with a system URL of /taxonomy/term/1 that is accessible by the URL alias /holidays. Then I want ...
berliner's user avatar
  • 2,854
0 votes
1 answer
82 views

Node url alias pattern based on taxonomy not working properly

I have taxonomy named Category with two terms: News and Articles. Articles term has custom url alias - /useful. The website was upgaded from D7 to D9. On old D7 version node url pattern was [node:...
bigboy's user avatar
  • 71
3 votes
1 answer
735 views

Pathauto alias full path for hierarchical taxonomy terms

My client has content tagged by a hierarchical taxonomy of arbitrary depth. Currently the maximum depth is three, but that could change: ParentTerm └── ChildTerm └── GrandchildTerm Each Term has ...
hotwebmatter's user avatar
  • 2,112
2 votes
1 answer
1k views

Example hook_pathauto_pattern_alter

I do not understand the hook. I would expect, that "pattern_alter" would allow me to "alter" the "pattern". But this seems to be not the case. I tried also to alter the ...
mogio's user avatar
  • 697
0 votes
1 answer
517 views

Get path (alias) from SQL query

I have a SQL query to get all nodes with their ID, title, publish date, change date, etc. Additionally I need to get path to each of them (probably from path_alias.alias). Now I have following (...
mixerowsky's user avatar
  • 1,581
0 votes
0 answers
33 views

Content Translation installation breaks the website (statistics module error + aliases not taken into account)

First, I would like to say I am a total noob in Drupal and PHP but possess some knowledge on other web frameworks/languages). Here is my path to the errors: I used the UI to install Content ...
Dna's user avatar
  • 1
1 vote
0 answers
98 views

Why doesn't breadcrumb work for taxonomy terms?

I have created url patterns for the taxonomy terms in the "Article category" vacabulary. I want the breadcrumb trail to look like this: "Accueil"> "Blog"> "...
gerff's user avatar
  • 23
0 votes
0 answers
205 views

How to disable an alias path (for an unpublished page)?

As path aliases now seem revisionable (from 8.8.x, see Convert path aliases to full featured entities) what is the best way to set an unpublished page (that was unpublished by a content moderation—as ...
GlenA's user avatar
  • 1
0 votes
1 answer
374 views

Hide/mask link URL in the web browser

I'm new to Drupal and here is the requirement - There is a page that has a field (Doc link) of type Link. I give the URL of the Doc link field as /sites/default/files/docs/file1.html. Now when I click ...
Shikha Mukesh Kukreja's user avatar
2 votes
1 answer
744 views

Pathauto pattern for a content type depending on a reference field?

This question is already asked here, but the answer selected does not work for Drupal8. Description: There is a content-type, which has field, referencing taxonomy term. The term is in "Content ...
A. Genchev's user avatar
0 votes
2 answers
2k views

Contextual Filter Path Alias

I searched for this for some time now but couldnt find an anwser. I am using drupal 9.1.5 and pathauto. I have content types department and depratment news. The news are linked to the department. So ...
michael's user avatar
0 votes
0 answers
24 views

Unable to use pathauto aliases for taxonomy terms in conjunction with views pages

I'm trying to set up pathauto aliases for a number of vocabularies to work alongside corresponding view pages. However, in doing so, I'm running into a 404s ("The requested page could not be ...
Chris's user avatar
  • 1
0 votes
2 answers
1k views

How do I include special characters in a path alias?

I'm trying to add a path alias for a node, /student-&-courses/maths, but in the URL it is displayed as www.testone.com/student-%26-courses/maths. I unchecked the Generate automatic URL alias ...
Jake13's user avatar
  • 49
1 vote
1 answer
265 views

Upgrading to core 8.8 results in a path alias error

I have been trying to upgrade a site from Drupal 8.7.7 to 8.8, and following the release documentation, I upgraded the core and pathauto module at the same time. So my composer.json has the core set ...
Sidney Sousa's user avatar
0 votes
1 answer
624 views

How do I apply path alias patch?

I am updating a site from Drupal 8.7 to Drupal 8.8, and after running a drush updb, I encountered this error: [error] TypeError: Argument 2 passed to Drupal\pathauto\AliasStorageHelper::__construct() ...
Sidney Sousa's user avatar
0 votes
0 answers
41 views

How can I make my userid point to /user/*/ instead of pointing to /user/*/home?

Currently if I set my pathauto pattern to: u/[user:account-name] The result I receive is: Alias: /u/michelleclark System Path: /user/5/home I would like to recieve the result of: Alias: /u/...
Ares's user avatar
  • 1

1
2 3 4 5
17