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

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].

0
votes
0answers
15 views

Restrict access on system path for nodes, but keep URL alias

I use path aliases on my Drupal 8 site. How can I restrict the access of the system path for normal users and bots to resolve the issue of duplicate content issue for SEO reasons? I only want the ...
0
votes
0answers
33 views

Grandchild Pathauto from Nodes

I have a node that has a parent_field (entity reference) that if left empty, that node is a parent. If parent_field has data (ie the nodes parent node name) then I can easily add pathauto in there ...
1
vote
1answer
54 views

How to create URL alias for node edit page

Pathauto can create URL alias for node view page, for example, URL from node/nid to project/nid (project is a name of content type), but the link to the edit page is not /project/nid/edit, but /node/...
0
votes
0answers
33 views

Remove string from [node:url] and node alias

Background We have enabled content translation where we detect based on the content language. This allows us to translate properly as needed, but it has a bad side effect. It will not only add ?...
0
votes
1answer
30 views

Multiple URLs for same node

anyone know how to create a URL alias and not redirect the user? I have a node with its alias set to /sign-up, but I also want it accessible via /caregiver/sign-up. I created a URL alias, but it seems ...
1
vote
1answer
46 views

How to display the path without alias?

With Drupal 8 and Commerce 2.10 I created a php code to display the link of my store. When I go to the link, it displays: https://www.domaine.com/shop/name I want to display without alias: https:/...
0
votes
0answers
27 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
30 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
33 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
26 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
40 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
52 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
44 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
18 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
43 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
176 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
27 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
208 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
41 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
34 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
93 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
17 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
24 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
43 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
76 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
31 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
385 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
73 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
169 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
233 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
54 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
43 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
35 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
132 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
463 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
41 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
41 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
117 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
31 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
21 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
28 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
51 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
38 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
47 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
127 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
332 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
730 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/...