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
2answers
525 views

How to stop redirecting to newest URL after updating a node

I have setup 2 aliases for each node of a content type called "property". The first alias is like example.com/texas/village-apartments and the second is example.com/texas/corp/village-apartments. ...
67
votes
9answers
119k views

How do I get the current path alias or path?

How can I get the current alias and/or path in Drupal 8? In Drupal 7 I did this with drupal_get_path_alias(). What is the equivalent code I should use in Drupal 8?
4
votes
1answer
657 views

How to use url alias in views for taxonomy terms?

On a Drupal 7 site with pathauto installed I'm using a view to show all taxonomy terms of a given node. The terms are linked to the term's page. The problem is, that the path of those terms does not ...
6
votes
2answers
446 views

Managing custom aliases on translated content

We have a Drupal 8 site with translated content, and using the Pathauto module. The issue we are running into is that when we un-check the "Generate automatic URL alias" on, say, the Chinese node, ...
2
votes
1answer
349 views

How can I create an alias to point to an uploaded file?

Users uploading a file within content create a name like my_site.com/sites/default/files/import/CrazyLongNamefile.pdf They would like to alias it for referencing in other media (print) like my_site....
4
votes
1answer
648 views

Import URL Alias with Node

I'm using ne-impot and ne-export with drush for importing and exporting nodes. When exporting, as part of the uuid module, the URL alias is included with the export. However, when importing a node, ...
-3
votes
0answers
33 views

When I create or modify a page, a random URL is created

Usually I set an URL with the title of the page, but even if I set the URL I would like, I got a 404 error if I try to visit a page using that URL, but if I try to visit the page from the contents ...
1
vote
1answer
740 views

How can I get the translated path to the current node?

How to get path to current node but of another language? Available languages: English (URL prefix: en) Polish (default, no URL prefix) Enabled detection methods: URL (by prefix) Session (parameter:...
1
vote
1answer
697 views

Passing arguments to a node with an alias url

There is a similar issue in here: Passing an argument to a node causes 404 But there is no real viable solution. I tried using the sub-pathauto module but the restiction of 8 arguments is too little, ...
1
vote
2answers
653 views

Views, Pathauto and contextual filters

My question is rather simple, but I didn't manage to find anything that can help. Summary of my setup : Pathauto Views Entity Reference So I have various custom content types, which I want to ...
0
votes
1answer
692 views

How to make private (hidden) node path aliases?

The site (Drupal 7) has regular nodes that are publicly visible via standard node alias (node/<nid>). I need to be able to create hidden (private) node aliases that are random (e.g., node/...
0
votes
1answer
347 views

Multiple aliases per node (and active trail)

Our site is split down the middle for tenants and landlords. But we have content the is the same for both such as "how to report antisocial behaviour". User would normally navigate something like "...
0
votes
1answer
42 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 ...
1
vote
1answer
141 views

Pathauto bulk update for taxonomy terms with unchecked “Generate automatic URL alias”

I have the same issue addressed for D7 here: Bulk Generating URL aliases for taxonomy terms doesn't do anything or here: Bulk update for unchecked "Generate automatic URL alias" And I'm ...
0
votes
0answers
15 views

How to expose the URL alias of a taxonomy term in a View?

I have a View showing Taxonomy Terms as JSON, and want to expose the URL aliases of those terms: { "terms" : [ { "term" : { "name" : "Media ...
33
votes
8answers
47k views

Get path alias from NID (or node object)

I have a node object, and I am trying to use it to get a given path in Drupal 8. There was drupal_lookup_path() in Drupal 7 but I'm not seeing any equivalent or documentation for Drupal 8. What's ...
0
votes
1answer
777 views

When adding Content: has taxonomy term id contextual filter to view and check specify validation criteria box, why don't I see validation options?

My request is closest to these two questions: Filter by multiple taxonomies in URL Views contextual filters taxonomy name I have a view which is a page and displays node titles in a table format ...
0
votes
2answers
866 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 ...
0
votes
1answer
978 views

Pathauto insert taxonomy term custom url

I have change the url of an taxonomy term. Now when i use a field with taxonomy term the url is showing like this: [node:field-taxonomy:parents:join-path]/[node:field-taxonomy:name]/[node:title] ...
1
vote
1answer
673 views

Redirect to 404 page, if URL alias does not exist

I am developing multilingual site in Drupal 8. I added content in Turkish language and did not create any translation for that node. Suppose node ID is 123, so system URL is http://example.com/tr/...
0
votes
1answer
1k views

Change url alias for user profile pages based on role

I have two sets of users, faculty and staff, with corresponding Profile2 profiles. I can't figure out how to get different paths for users dependent on roles, e.g, staff/userid or faculty/userid. I'...
1
vote
1answer
1k views

Multiple URL aliases for same node

I have the following URL aliases for the same node. /products/single-room/product-listing/wall-mount /products/multi-room/product-listing/wall-mount I have two details button Single & Multi-...
0
votes
1answer
483 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 ...
0
votes
4answers
199 views

Get Url Alias in Algolia

I have implemented an Algolia search in my drupal instance and would like to use the node url alias (/some-example-path) rather than node id (/node/{nodeId}). Is there a quick and easy way to do this ...
1
vote
1answer
600 views

Creating multiple URL aliases for the same node with their own context

I want to solve the following problem with Drupal 7 solely using existing modules and without any extra code. I have a contenttype called 'News' I create a news item and assign a taxonomy term called ...
0
votes
1answer
349 views

How can I use tokens for Addressfield values without using Addressfield_tokens?

I would like to use the Town/ City field as a token for Pathauto. I thought the Addressfield_tokens module was perfect for this, but Entity Tokens breaks Pathauto's patterns control panel; the issue ...
3
votes
2answers
405 views

Custom Path Alias with Initial Letter as Token

For various reasons, I need to change my custom path alias for a taxonomy type as follows... FROM: /composers/aardvark TO: composers/a/aardvark So I'm looking at either creating a custom token, or ...
0
votes
1answer
19 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
4answers
362 views

Create two nodes with url aliases on one submission

I have a content type "News". With URL aliases pattern and token the URL is like this: news/[node:title]. Is it possible to create two nodes on one submission with different URL aliases? Let's say on ...
1
vote
3answers
717 views

Show 404 on page for node path url instead of redirecting to it's alias

I'm currently using the Redirect module in Drupal 8 along with Pathauto to create aliases on all url's. So for example /node/23 would be /article/some-text-here. When a user types in /node/23 in the ...
2
votes
1answer
369 views

Language switcher does not display the correct link to the default language path

I maintain a bilingual English/French website and the Language Switcher block is available on every page to allow the user to switch language. It works except on one particular taxonomy term page and ...
0
votes
3answers
89 views

Make node only accesible by path alias

I was wondering if it's possible to make nodes without path alias not accessible. By this I mean that visiting /node/$nid/ users will not be able to see its content, but if that node has an path alias ...
0
votes
2answers
57 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\...
2
votes
1answer
507 views

Ignore parts of the url or dynamically rewrite/alias the url

I am having a problem and have been wrecking my brain over it... I feel I might ohh how did I not think of that moment once I find the solution... Basically, what I need to do is: For any url ...
3
votes
2answers
372 views

Drupal 7 Views url translated alias with contextual filter

I want to translate the url of my view. So I've made a translated alias for it. But when I add a contextual filter I get a 404 error. For example: I've a view with the url example.com/overview with ...
1
vote
2answers
513 views

How to create a organic group path alias

I'm trying to create a path alias for a node type, where the first part of the alias is the url path of the organic group. I tried this [node:og-group-ref:1:url]/[node:content-type]/[node:title] ...
0
votes
1answer
432 views

Same path for different domains

I have Drupal 7 with Domain Access on it. On the main domain i have an About us page with the path www.example.com/about-us How can i get same "/about-us" path on several subdomains like domain....
1
vote
1answer
687 views

Redirect taxonomy term page links to a View page's exposed filter

I'm trying to make every taxonomy term page link direct to a pattern like this: /viewpage?[term:vocabulary][]=[[term:tid]] So, for example instead of material/bronze where bronze has term id 7, ...
1
vote
1answer
2k views

How to get term alias in twig templates

I have created a block to show the sibling terms of the term being viewed. In the twig template I am looping through the terms to display the names linked to their respective pages. Now I unable to ...
1
vote
1answer
1k 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/...
1
vote
1answer
413 views

URL aliases and Entity Translation (menu name replacement pattern)

I am using entity translation (Field translation) for my nodes, and set the menu name on each 'page'. The menu itself is arrange to basically have a duplicate tree in the same menu each with a ...
1
vote
1answer
479 views

Referencing parent entity

I've just started with Drupal and I'm trying to create the following URL structure with PathAuto and Entity Reference: Category A -> Category B -> Category C Resulting in category_a/category_b/...
0
votes
1answer
54 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 ...
3
votes
4answers
1k views

How can I create unique path alias for image styles?

image_style_url returns the public url of an image in the files/styles folder. Is it possible to create alias to that? What I want is the following: Call image_style_url from the image style and the ...
1
vote
1answer
44 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
1answer
641 views

Mask a dynamic URL

Is there a way to mask a dynamic url in Drupal? Original URL: site.com/user/%/orders Masked URL: site.com/orders
0
votes
2answers
94 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
27 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
1k views

'The alias is already in use' when editing a node that had an alias generated programmatically

I'm currently using an event subscriber to latch onto an event from a module that creates and/or updates nodes. I'm programmatically setting the url alias based on a user inputted field by doing the ...
0
votes
1answer
17 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
2 3 4 5
16