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
1answer
21 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: /** * ...
0
votes
0answers
19 views

Modify paths for existing images on Amazon S3 to a public path

I'm going to change the way how images will be stored. At the moment I use Amazon S3 for the old added images, new images will be stored in the public destination and then S3 won't be used. My plan is ...
1
vote
1answer
128 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,...
2
votes
0answers
60 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 ...
0
votes
1answer
43 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 ...
2
votes
1answer
118 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 ...
1
vote
0answers
18 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-...
0
votes
0answers
20 views

Getting different Public path for admin and anonymous users

My site was built using Lightning Drupal distribution. I had my public path as /sites/default/files. I did change the configuration path to /sites/<my_domain>/files in the middle of the project. ...
0
votes
0answers
62 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 ...?
0
votes
0answers
15 views

How do you batch process a path alias change for nodes that includes a menu placement change?

We have an annual reporting sites that contains approximately 200 nodes each year. When the next year's reports are complete, all of the current year's nodes move to a path like /archives/fy2020/*. ...
2
votes
1answer
44 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 : ...
0
votes
0answers
95 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 ...
0
votes
0answers
55 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 ...
1
vote
1answer
219 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 ...
0
votes
1answer
23 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:...
2
votes
1answer
65 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 ...
1
vote
1answer
127 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 ...
0
votes
1answer
76 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 (...
0
votes
0answers
24 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 ...
0
votes
0answers
36 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"> "...
0
votes
0answers
71 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 ...
0
votes
1answer
62 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 ...
2
votes
1answer
155 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 ...
0
votes
1answer
115 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 ...
0
votes
0answers
16 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 ...
0
votes
2answers
258 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 ...
1
vote
1answer
101 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 ...
0
votes
1answer
286 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() ...
0
votes
0answers
40 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/...
3
votes
1answer
116 views

How can I add a Pathauto pattern for a content type depending on a reference field?

On my site I have a content type 'Article' that has a reference field to a taxonomy vocabulary 'Type of Article' containing terms like 'Blog', 'News', etc. Now I would like to have Pathauto form a ...
3
votes
1answer
274 views

Disable caching for a front page path processor

I’m working on a project where users can create a book (core functionality). In a simple text field they can connect a domain to this book. This way the book is only accessible via this domain. For ...
0
votes
1answer
92 views

How do I prevent node enumeration?

I am currently developing a Drupal 8 site that will consist of one only central content type with a minimal menu structure. The user is supposed to navigate the site only by using a search/filter form ...
0
votes
1answer
31 views

Path alias and taxonomy term view

I have PathAuto providing /term/[term:name] for terms of a specific vocabulary. If I hover over the link for any of the terms, the path given is the alias. When a term page is requested, e.g. /...
0
votes
2answers
196 views

Drupal 8 service dependency injection [closed]

I am trying to build a service that will leverage the Pathauto service so my class looks like this. namespace Drupal\some_system; use Drupal\pathauto\PathautoGenerator; use Drupal\pathauto\...
0
votes
1answer
162 views

Translate path controller

I have the following path defined in my routing.yml: path: '/department/{department_node}/qualifications/{qualification_id}' I need to translate that route into other languages, for example into ...
1
vote
1answer
48 views

How can I change which view wins over two using the same path?

I have two views in Drupal 8. The standard Taxonomy term (content) view, path: /taxonomy/term/% My custom view for just one term at path: /term-alias When I go to my custom term, I see the view for ...
0
votes
2answers
587 views

Get path alias of node on presave

I was trying to get the path alias using for nodes using the following code. \Drupal::service('path.alias_manager')->getAliasByPath('/node/' . $nid); It works for nodes that are already created, ...
0
votes
1answer
309 views

How to get taxonomy tree with path auto token?

I'm using Path auto module to automatically set url of articles. Last part of url is node title and [node:title] works just fine. But url part before node title should follow taxonomy structure (tree) ...
0
votes
1answer
82 views

How do I use Taxonomy reference field tokens in a path alias?

I have a content type with two taxonomy entity reference fields. Both are required fields that only allow one value. I have path_auto and token enabled. I would like to use them to set the path of the ...
1
vote
0answers
70 views

How do I set the path alias for nodes imported via RSS feed?

In Drupal 8, I have created nodes of article type using the Feeds module, using a RSS feed as source. How can I create path aliases for each of the imported nodes? I have tried to map source:'item ...
1
vote
1answer
135 views

Is the path_alias table queried for all URLs?

I'm trying to generate SEO-friendly URLs for a set of exposed filters. For e.g.: /analyst-relations/firm?related_firm=5072 would look like /analyst-relations/firm/forrester one way I imagined doing ...
2
votes
2answers
619 views

Delete any path alias by language

We are running Drupal 8.8.5. I can see duplicate aliases when I look at /admin/config/search/path. Unfortunately, there are many duplicate aliases on our website with 6000 URLs. The /node/1 node has ...
0
votes
1answer
43 views

Deactivate system path

I want to deactivate the system path which comes with Drupal. I've installed the pathauto, so when I create a new page, it automatically changes domain.com/node/12 to domain.com/books/jacks-journey ...
0
votes
0answers
27 views

Pathauto generating odd results

I attempted to create a pattern using Drupal Commerce 2 categories and product title. [commerce_product:field_categories:1]/products/[commerce_product:title] When I generate the url alias I get ...
0
votes
0answers
31 views

A content type with two or more view displays with custom URLs

I have a content type that requires different views. I am defining multiple view modes in the content type manage display page and using view page mode. This works fine if the url is /%/{view mode} ...
0
votes
1answer
294 views

How to route dynamic routes to a single node while keeping the urls?

I have a node node/1 with the path alias /path. What I want is for /path/* to always behave like you went to /path, but not change the url. So going to /path/test?something=1 should behave identically ...
0
votes
2answers
211 views

How to get the raw value of the url in a link field

I'm doing this: $link = $node->field_link->first(); if ($link) { $url = $link->getUrl()->toString(); ... } If the value in the link field is /node/123 but there is a URL alias ...
1
vote
3answers
305 views

Where and how to conditionally redirect old aliases to new aliases

We are replacing a website with a new version. The domain is the same, but URL aliases in the new website are different. In many cases, I can use an old alias to calculate its corresponding new ...
0
votes
0answers
22 views

URL translations transposing between primary and secondary languages or just displaying wrong

We have a Drupal 8.7.10 site, multilingual (17 countries localized with 2 or more languages each). In the example I am attaching, we have a "people" page where we are listing people for our company ...
0
votes
0answers
60 views

Query params in url does not appears in node url after updating

I need to append node path programmatically to make the url look like [the link]?utm_source=Home%20Page&utm_medium=website&utm_campaign=AB%20Test&utm_content=Headline A I'm updating node ...

1
2 3 4 5
17