Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

0
votes
0answers
23 views

handle URL alias with URL query Parameter

Im using the newest Drupal 8 Version, which is hosted by Bitnami on an ec2. Basicly im trying to transform an URL which contains URL querys to an user friendly URL. So: www.xxx.com/article?shop=A&...
0
votes
0answers
26 views

Use sub aliases on custom module block to pass parameters

I'm trying to integrate an API into a customers Drupal 8 page. The goal is to show a list and a detail view of job offerings. I decided to create a module with two blocks - one for each use case - ...
0
votes
2answers
29 views

Turn /node off but keep aliases

I want my node page turned off. I don't want mysite/node/3 to work. I want it to display 404. I tried rabbit hole and it worked but the problem ws that it also stopped the aliases from working. Is ...
0
votes
0answers
18 views

Error on URL aliases unable to find the reason

I am using path and pathauto module on my project. It was a old project recently I updated the core and all contributed modules. After that the pattern of path for URL aliases was working fine. But ...
0
votes
1answer
29 views

Programmatically delete pathauto alias pattern?

I know how to remove a pattern via the UI. Is it possible to do this programmatically to be used in hook_update()? EDIT: I think asking this answered my question. Will post a followup answer. ...
0
votes
2answers
42 views

Select the right pathauto alias for a node

I'm working on a drupal 8 project, I need to access the content type X nodes via two aliases depending on some conditions, for this I've created two Pathauto patterns using Pathauto contrib module: ...
0
votes
1answer
36 views

Alias / to /lang_code

I got a multilanguage configuration with language detection based on URL(/en /fr). Drupal behavior redirects everything to so it would have those two prefixes or, if setup, it will ignore the prefix ...
0
votes
0answers
15 views

Vocabulary Terms redirect 404 page not found

I am using drupal 7.59 Today i see the my taxonomy's terms redirecting page not found. these topic i have done but the issue is still happening. I'm using pathauto module in this module i have ...
1
vote
0answers
39 views

How do I set a url query parameter node/{node}/edit for a specific content type?

I'm trying to add a taxonomy term from the node in question as a url parameter, but am struggling to figure out how to do it without just going through the site and modifying all of the links that ...
2
votes
2answers
123 views

How do I remove the default node path when using a path alias?

When I add path aliases, how do I remove the system path (/node/[nid]) in Drupal 8, to avoid Google to index the page twice?
0
votes
1answer
17 views

Contextual Filter not working wiht URL aliases

I have this issue with contextual filter. I have set the filter so it would get an ID of an article and based on that ID, it would show the name of the author. The problem is, it doesnt work with URL ...
1
vote
1answer
69 views

Create custom URL pattern

Using the pathauto module, we could have created custom URL patterns using the hook_pathauto(). I could not find any such way to achieve the same in D8. ref. https://envisioninteractive.com/drupal/...
0
votes
1answer
30 views

URL Pattern in node entity reference

I have a content type A, which contains an entity reference field. That field references a content type B. I have create automatic URL paths for both content types. When I create a new node of type A,...
0
votes
0answers
33 views

Two different content paths for the same content type with different taxonomy terms

Sorry for the inaccurate title. I have a content type called product display. In product display I use taxonomy terms, 8 different term names, to categorize the different products. However, I have ...
0
votes
0answers
15 views

Admin path broken after localisation removal

I tried to fiddle with some localisation using modules content_translation, config_translation, locale and language. The problem is, after uninstall of all of the above, the frontend links for block ...
0
votes
1answer
49 views

Pathauto conditions

Is it possible for Pathauto to have one pattern for a content type, and a different pattern for the same content type based on the value of a field in that content type? I have a checkbox field and if ...
0
votes
1answer
16 views

How to use user wildcard in a custom path?

I have configured my user path alias pattern as consultant/[user:name]. Now I need to have one custom path from my custom module as consultant/[user:name]/job. Here is my code in hook_menu. $items['...
0
votes
1answer
21 views

How do I display a taxonomy term if another term is active for a node?

I have a content type that has taxonomy terms for Category, like Blog, Publication, and Project. Depending on which term is selected, the content is displayed under blogs, publications or projects. If ...
0
votes
1answer
39 views

Views Contextual Filters - User Name in URL

I have a view set up to function as a blog, and a contextual filter set up to filter by author of the blog post. The point is to be able to click on the blog post author link and go to a page that ...
0
votes
1answer
62 views

Can't migrate alias with Wordpress Migration

I am using the Wordpress Module to migrate from Wordpress to Drupal 8. I am trying to have the alias be set to the link value (<link>https://myurl.com/wordpress-path</link>). I added the ...
0
votes
1answer
25 views

URL alias to access user profile as admin

I realized that users on my site have their path ending in the form "user/number" (for example: user/3) when I check People in the Admin Toolbar and click on their username. I would like to use URL ...
0
votes
0answers
12 views

Language specific node after updation redirects to /node/xyz instead of lang/alias on Drupal 8.5.3

Here are the steps . Load the page in browser mydomain.com/eu/custom-page Click on contextual edit button which opens the drupal editing interface. Make updates on custom-page node. Save and Publish ...
1
vote
1answer
330 views

Get node internal path from path alias in Twig template

I want to get the internal path of a node from its path alias. In Drupal 7 we could use drupal_get_normal_path() directly in the PHP template. With Drupal 8, Is there a function to get the internal ...
0
votes
2answers
51 views

How to map path aliases when migrating from Drupal 6 to 8?

When migrating from Drupal 6 to 8 i can simply map path aliases with the mapping: process: path: alias I have the problem that the path alias is not set properly when pathauto is activated for a ...
0
votes
2answers
135 views

Pre-populate an Entity Reference when Adding a Node : Based on URL Alias

I am trying to pre-populate an entity reference with a specific game node, when a profile node is added; based on URL of the game the add button is on. The game node I want to reference in profile ...
3
votes
1answer
194 views

convert node/id to node/path-alias in content body

I added a link to a content body from ck editor as /node/7. When viewing this page I want to show www.sitename.com/example/alias. This is working fine in drupal 7 (earlier version of my site), but ...
1
vote
1answer
36 views

How to change the system path of a taxonomy vocabulary to correspond a view

I'm using Drupal 8 and i want different vocabularies to be displayed by different views. Each view should have a different path with a contextual filter but when i define my path on pathauto the ...
2
votes
1answer
42 views

Is it safe to allow domain.com/username?

Are there any security risks if we create pathauto roule so that the user account pages are at domain.com/username
0
votes
1answer
32 views

Is it possible to alias paths for contextually generated page views?

I have a content type with a path pattern ([category]/[english_title]) that is generated based on its field values. In the node's page there is a block with referencing news items and a count based ...
1
vote
1answer
99 views

How do I set a path alias for each forum?

I created a forum on a site using the core Forum module. When we create a new forum, Drupal creates it as a taxonomy term. When we create the new forum, if we associate a path alias, that URL alias is ...
2
votes
2answers
365 views

Alter url aliases programmatically

I have a pattern set up to create the URL aliases based on a field of type list text. the field looks like this: selection 1|selection 1 selection 2|selection 2 How can I alter the alias so it ...
0
votes
1answer
37 views

Get current country pathPrefix

How can I get current country pathPrefix in D8 ? I know drupalSettings.path.pathPrefix gives that in JS, but how can I get it in preprocess hook ? Following gives only the path alias, but without ...
0
votes
1answer
39 views

How to set alias pattern of node's source alias?

When I translate a node I want that node's path alias to be like it's source node's path alias. So in the url pattern for the translation nodes I use the token: [node:source:url:path] which ...
0
votes
2answers
106 views

Translation view path broken after upgrade to 8.5.1

After upgrading my site from Drupal 8.3.5 to Drupal 8.5.1, the token {{ path }} is not translated anymore in the selected language. Does anyone have a suggestion or solution?
0
votes
1answer
30 views

make taxonomy terms more human friendly

I work on a news site that has hundreds of articles and all the article urls are written by hand. eg. example.com/world-news-today-28-march-2018 The site has various news categories like: business, ...
0
votes
1answer
17 views

Entity id availability in Custom Field

I've created a Custom Field (let's call it 'Reference') whose value requires the Entity Id. To accomplish that I modify the Field value in the postSave method, like this: if (!$update) { $this->...
0
votes
1answer
26 views

How to do path aliases for views like news/%?

Let's suppose we have a view like news/%. Where news is my content type, and % is tid of term id from vocabulary "categories". Obviously that urls like news/3, news/5 etc. works great. But how to do ...
1
vote
1answer
46 views

delete URLs of all terms for a specific taxonomy vocabulary

Using pathauto module, I know we have a Delete aliases tab to delete URLs in bulk but what if we need to delete URLs of all terms for specific vocabulary? Any idea how to do that?
0
votes
1answer
35 views

Where does the menu trail get added into the $data parameter in pathauto_tokens()?

I have seen this post: where does $data come from in hook_tokens?, but that did not help me answer my question, maybe it could've but there's no way for me to interact with that post. I am working in ...
0
votes
1answer
24 views

Why the path alias is like http://domain/http://domain/path?

Adding a simple alias for media [media:url] causes the domain to be listed twice in the URL on media listing page in admin, for example http://domain/http://domain/path. How do I change it to http://...
0
votes
2answers
44 views

is there a way to customize url alias by content type?

I have several contentypes, url alias are working fine, by default if there is a space in node title (or another token) is replaced with a dash "-", is it posible to change that beheavior by ...
0
votes
0answers
107 views

Parent taxonomy term token not translated

I have a vocabulary like this : Vegetables Potatoes Eggplants They're all translated this way : Légumes Pommes de terre Aubergines Default language is in french. In my URL Aliases patterns for ...
1
vote
1answer
264 views

How do I get the path alias without the language code?

Suppose I have an alias like http://www.example.com/en/the-new-webpage.html. I want to get the the-new-webpage.html part in hook_preprocess_html(). The language code might change into 'ja' or some ...
3
votes
1answer
549 views

How do I define a Route with multiple different paths?

Does Drupal's routing system support a regular expression or other means for multiple route paths? I have a route that I would like to be able to hit from two different endpoints, /api/v1/foo and /api/...
1
vote
2answers
52 views

Creating two aliases for the same node

I have a content type with a field allowing to select public or private. I am using the Pathauto module for generating path aliases using this field, using /[node:field_evt_diffusion]/[node:title] as ...
0
votes
0answers
31 views

Trying to get it to correctly display the language with the alias in the URL

I have a form that I want that taking the alias of the taxonomy create a URL path and take me to it. The submit has two options, show the default URL that does it correctly and the second that is ...
0
votes
2answers
37 views

Bulk Generating URL aliases for taxonomy terms doesn't do anything

In D7, I've imported ~8000 taxonomy terms. All these need to have a url alias, based off their names. I can check the 'Generate automatic URL alias' checkbox when editing each taxonomy term ...
0
votes
3answers
110 views

D8 generate double URL for commerce product

I need to create double URL alias for commerce product. I tried with code below : function mymodule_entity_update(Drupal\Core\Entity\EntityInterface $entity) { if($entity->getEntityTypeId() == ...
0
votes
0answers
9 views

Drupal 7: Custom Module Paths keep disappearing

Recently, I've noticed on two Drupal 7 sites that any custom menu paths defined in hook_menu in custom modules disappear seemingly at random until the cache is flushed. The most recent time this ...
0
votes
0answers
27 views

Pathauto is converting special characters (accented) by interrogation points

I created a Drupal website some years ago and everything was working well until now. But since yesterday (when the client came back to me), the Pathauto module is now replacing all accented ...