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].
839
questions
2
votes
1
answer
1k
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 ...
1
vote
2
answers
438
views
Pathauto tokens for taxonomy terms except root
Thanks to the Pathauto module and tokens, it is very easy to generate URLs with [node:field_product_category:entity:parents:join-path]/[node:field_product_category:entity]/[node:title], but I would ...
0
votes
1
answer
1k
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
1
answer
1k
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
2
answers
533
views
How do I create a 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]
...
2
votes
1
answer
374
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 ...
7
votes
2
answers
715
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, ...
0
votes
1
answer
34
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 ...
2
votes
1
answer
613
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 ...
0
votes
1
answer
45
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 ...
0
votes
1
answer
508
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
2
answers
483
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
1
answer
507
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
2
answers
1k
views
Redirect to 404 page, if the path alias doesn't exist
I am developing a multilingual site in Drupal 8. I added content in Turkish and I didn't create any translation for that node.
I managed to redirect user to the path alias. For example, when users ...
1
vote
1
answer
980
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:...
0
votes
0
answers
49
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}
...
1
vote
2
answers
635
views
Where in the MySQL database schema is the URL alias for a group relation?
I am building a report outside of Drupal that pulls data from a Drupal 8 database. The report shows titles of different nodes and I want to link those titles to the web page for that content. This ...
2
votes
2
answers
481
views
Strict case in content URL alias
(Pathauto: Leave case the same as source token values)
When I create a node with "Nullam vehicula pharetra" as title, the Pathauto module will create /content/Nullam-vehicula-pharetra as URL alias. ...
0
votes
1
answer
372
views
my urls are not replacing spaces with hyphens
I have url aliasing and clean urls. They are making the content have good urls, but for some reason it's not always rendering with hyphens. It leaves the spaces and breaks pages.
4
votes
1
answer
711
views
Import a node with its path alias
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, ...
1
vote
1
answer
1k
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, ...
0
votes
0
answers
24
views
Fetch redirect alias using the old alias
I want to get the current alias of the node using an old alias. I do have the Redirect module installed and all the old aliases of the nodes are mapped to the new ones. But I am not able to fetch the ...
4
votes
1
answer
905
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 ...
1
vote
1
answer
850
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
1
answer
512
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
1
answer
1k
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 ...
5
votes
2
answers
3k
views
How do I mimic Pathauto transliterated output for an alias in my custom PHP code?
When writing my custom function I need to manually append node name to a taxonomy term link. To get the taxonomy term part done I use:
$link_uri = taxonomy_term_uri($term);
$path_alias = ...
0
votes
2
answers
582
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.
...
1
vote
1
answer
439
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 ...
0
votes
1
answer
638
views
How to reference URL relative to current page in a block
I have a custom block where I need to reference a URL relative to the current page (such as node/7/images or node/293/images) that will link to the "Images" view mode I made for the node. I am using a ...
0
votes
1
answer
850
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
1
answer
2k
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
2
answers
821
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 ...
1
vote
1
answer
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-...
24
votes
4
answers
24k
views
How can I get the node ID from a path alias?
I want to be able to get the nid but the only information I have is http://example.com/this-is-the-alias.
Is there a way to get either the internal path of /node/* for that alias if I am not on the ...
3
votes
1
answer
1k
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 ...
0
votes
4
answers
471
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
1
answer
68
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 ...
0
votes
1
answer
786
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 ...
1
vote
0
answers
23
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 ...
0
votes
1
answer
357
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 ...
0
votes
1
answer
100
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\...
2
votes
3
answers
845
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 ...
4
votes
2
answers
2k
views
How can I show the user login block on the 403 page?
With D8, I have a node (content type: basic page) that I use as a custom 403 (access denied) page.
I set this as the custom 403 page on: /admin/config/system/site-information. The path is /node/21, ...
1
vote
1
answer
119
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):
{ &...
0
votes
1
answer
61
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 ...
3
votes
2
answers
547
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
1
answer
128
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 ...
2
votes
1
answer
104
views
Is it possible to turn off the auto-pathing for the Pathauto module?
I want to avoid the Pathauto module automatically creates node path aliases.
Is there a way to disable it?
I could want to enable it later, so I don't want the module cannot anymore automatically ...
1
vote
2
answers
69
views
Is there a way to make aliases as short as possible?
For instance, if you have three tokens, let's say [city], [state], and [country]
is there a way to do this:
/[city]-[state]-[country]
and then let's say there are three cities, Venice, in different ...