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
3
votes
2answers
1k views

How do views Contextual Filters behave with Pathauto?

I have Pathauto installed, so URLs to nodes are not like node/3. My question is that if I write a View with a contextual filter for looking for node/3, will it work? Note: This contextual filter is ...
3
votes
2answers
2k views

How to support legacy url alias' and/or support multiple url alias' (Conditional Pathauto?)

I am migrating a site from wordpress and need to preserve my url structure whilst supporting native pathauto urls in the future (for new content) Overall Drupal's clean url process is almost ...
3
votes
1answer
508 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 ...
3
votes
3answers
2k views

Multiple path alias for a url

I've installed the pathauto module. I have a content type article. When I'm trying to create an article, the path is created automatically in the form content/article-title, that is fine. However, I ...
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 ...
3
votes
4answers
3k views

Pathauto for a multilingual site not generating alias for non-default languages

I have a site with 90% content in Chinese, and only 10% in English. Thus the requirement of the client is that when viewing an article in English, everything around it remains in Chinese. Blocks, ...
3
votes
1answer
1k views

Why does Views PHP give me NULL for $row->path?

I have a views block to display only the titles of some few nodes. Titles linked to the single node. I want to have a CSS class .active added to the title's links when the linked path matches the ...
3
votes
1answer
325 views

Dynamic footer link based on current url

I've got a link to the mobile version of my site in the footer, but I need this link to be dynamic based off the page that the user is currently on. Shown below are the options I have for the link. ...
3
votes
3answers
3k views

Menu doesn't link to alias URL

I'm having difficulty on a fresh Drupal installation getting the menu to use an alias (let's say "foo") rather than "node/#" link. The alias works when I type it straight into my browser. When ...
3
votes
1answer
1k views

Rewrite user edit page url

On my Drupal 7 website, I would like a uri like folder/subfolder/preferences to be an alias for the user edit page user/<uid>/edit for all users. To be precise, when a user navigates to ...
3
votes
1answer
550 views

How do I automatically get the “Automatic alias” option checked for the content type?

I have the Pathauto module, and I want to have the 'Automatic alias' checkbox selected by default for the new content types I create. Is there a way to obtain this?
3
votes
2answers
2k views

Views won't handle my pathauto pattern for taxonomy pages

I have two taxonomies on my site that need to be browsable independently using different Views. Therefor I decided to prepend the term paths with the vocabulary name. In PathAuto patter section I have ...
3
votes
1answer
2k views

Transliteration of Danish characters

I have a site running with these modules (among others): Pathauto Transliteration My problem comes with danish characters. Normally they would be replaced like this: Æ = Ae æ = ae Ø = Oe ø = oe ...
3
votes
2answers
1k views

taxonomy-term at the automatic creation of url alias of a content path

In Drupal 7, how i can use the taxonomy-term at the automatic creation of url alias of a content path?
3
votes
1answer
67 views

How can I validate a path used to create a page?

I'm in the process of creating my first D7 module, partly based on the tutorial found here. It's a pretty simple module that creates both a block and a page to show some content. To go a little ...
3
votes
2answers
369 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 ...
3
votes
1answer
601 views

Problem creating path alias in code

I am creating a node and a path alias roughly as follows: <?php $node = (object) array( 'type' => 'article'); node_object_prepare($node); $node_wrapper = entity_metadata_wrapper('node', $node); ...
3
votes
2answers
620 views

How to setup custom 404 page that will ignore the path?

I have the pathauto setting up URLs as /Country/Dept/node-name (i.e. - /US/Training/How-To-Create-Node). If I enter a non-existent path at the root, it goes to my default 404 page I created. ...
3
votes
1answer
354 views

URL alias error

I want to configure the URL alias patterns on my site. When I try visiting the http://localhost/mysite/admin/config/search/path/patterns, I get an error saying "The website encountered an unexpected ...
3
votes
3answers
360 views

Pathauto and dynamic branch depth

I downloaded the Pathauto module to have the taxonomy aliases generated dynamically. The problem is that the pattern apparently expects a fixed depth, while my taxonomy is not that stiff - some items ...
3
votes
1answer
4k views

Pathauto taxonomy terms in content paths

I'm using pathauto and want to set it up so that when a new page is created (which has the taxonomy field) it will add the taxonomy terms into the url. For example, if I have the following vocabulary: ...
3
votes
1answer
76 views

Single path for multiple menus

I need to list nodes both in the main site navigation and within a section side navigation. Is it possible to target a specific menu for the Pathauto module to reference? This is an example of the ...
3
votes
0answers
738 views

How do I get the current node's parents (using PathAuto and Custom Tokens)?

A url for my site looks something like this: www.mysite.com/best-sellers/mistery/novels/this-is-a-book-title I want to remove "best-sellers" from that chain. I'm using PathAuto to generate my paths. ...
3
votes
2answers
402 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 ...
3
votes
0answers
152 views

How do I ensure active menu items are highlighted for Views with Better Exposed Filter arguments

I'm using Better Exposed Filters on a clothing site. There are various types of products listed using Better Exposed Filters (to choose between Mens/Womens/Kids). The Mens and Womens pages are ...
3
votes
1answer
341 views

path_set_alias() generates the wrong alias, and creates a 301 redirect to the desired alias's path

I'm creating a webform when organic groups are created and I'm trying to set an alias for it with hook_nodeapi(). It successfully creates the alias when the insert operation for the group is called ...
2
votes
4answers
8k views

How to programmatically set node alias on node save

I need to set a special path alias for nodes created by users in the template.php file of my theme. the pathauto module is enabled. I already tried the solutions that are given in the following links ...
2
votes
3answers
1k views

Why are IDs showing in URLs when clean URLs are enabled?

I've enabled clean URLs on my site, and currently, URLs are of the form: /node/123 How can I force them to to use human-readable URLs? Something like: /node/title-of-node
2
votes
2answers
8k views

Getting URL alias of a term

I am writing a module, and am confused about the term's URLs. because, if pathauto moduel is installed, then the alias of that module should be provided. How to achieve this? Default drupal's URL: ...
2
votes
2answers
3k views

drupal_match_path() for multiple wildcard patterns?

I want to add some CSS and JS to multiple matched wildcard URL patterns. According to Add javascript to multiple specific urls, I can use a wildcard using drupal_match_path() and that works well for ...
2
votes
3answers
705 views

Include AF container in pathauto URL

I am using the 'Advanced Forum' module with Drupal 7, in conjunction with the 'pathauto' module. I would like to include the parent forum, if not the container of the parent forum as well, in the ...
2
votes
2answers
596 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?
2
votes
2answers
440 views

How to create a redirect to point to the user's id?

I'd like to create a redirect so when the user hits mydrupal.com/my-account its redirected to mydrupal.com/users/3 I'm using Pathauto and I know I can go to admin/config/search/path/add to add the ...
2
votes
3answers
3k views

Programmatically create a node with alias and menu item using Entity API

I've seen the excellent documentation on Drupal.org about how to create a node in code, but that documentation doesn't address how to create the node's alias. I've seen code snippets that use $node-&...
2
votes
3answers
2k views

Is there a simple way to alter core node/add/my_node_type to adding/my_node_type?

I don't want to show "node/add" in my url "node/add/my_node_type", instead I want to have "adding/my_node_type". Is there a simple way to hide "node/add" but not loose those args? I want to have "node/...
2
votes
1answer
935 views

Saving existing node doesn't update automatic alias

I have a node with pattern /route/[node:title]. Whenever I save a new node with automatic alias checked it saves perfectly. Whenever I edit an existing node with Generate automatic alias checked it ...
2
votes
2answers
2k views

Why does my site still use URLs containing the “q” query parameter?

I have pathauto, transliteration and automatic node titles enabled. In the settings, my content path pattern is content/[node:title]. I expect the URLs to be in the format site/content/page-name, ...
2
votes
3answers
3k views

How to use term id in content paths using path auto?

How can I use term id instead of term name in path auto?I have a category field in my content type named "field_article_category" and there is a token [node:field_article_category] for it but it is ...
2
votes
4answers
6k views

In Drupal 7 how do I add an anchor tag to a path alias menu link

I created a node in drupal 7 and given it a url path alias of 'testing'. When I try to create a menu item that links to the path alias with an anchor, it throws an error If I do node/1#this it ...
2
votes
2answers
1k 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 ...
2
votes
1answer
1k views

Programatically redirect to node/nid doesn't redirect to url alias - Drupal 8

From what I understand the module 'GlobalRedirect' has been merged into the 'Redirect' module. So the redirect module should also redirect links as node/nid to it's url alias. When creating redirects ...
2
votes
3answers
2k views

Update url-aliase for nodes of a specific content type

I'm using drupal 7 in combination with path auto. I imported nodes of a specific content type using the feed importer, but the url alias is not set correctly. My problem is, that i can not use the ...
2
votes
3answers
481 views

Create a real taxonomy with drupal taxonomy and pathauto

I'm creating a taxonomy for reptiles in drupal and wish to use pathauto for the term url's. The problem is to find the right tokens (I do have entity token installed). Lets look at an example of the ...
2
votes
4answers
3k views

path issue with translated (entity_translation) nodes

I use Drupal 7, entity_translation and pathauto with 2 languages: EN, FR. I create a new content (of a content type with "entity translation") and I title it "test". Since Generate automatic URL ...
2
votes
2answers
807 views

Is there a module that changes “node” links to “alias” links? [closed]

I use global redirect, pathauto and redirect modules. Everything is fine, except one situation: I couldn't find the anwser, maybe it is very easy problem.. I can give links to nodes by using "link" "...
2
votes
1answer
69 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
2
votes
1answer
517 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
3answers
389 views

how can I change the site name [closed]

For some reason, I'm not able to change the name of this site. I try to change the name to 'Test Name', as shown in this screenprint: But after I save the page, the name is repopulated with the ...
2
votes
5answers
9k views

How to get nid from URL alias in drupal 7?

I have a URL alias sitepath/john/video/nature-beauty where john = user, video = content type and nature-beauty = node. I am trying to get nid of node nature-beauty. Node title is "Nature beauty" ...
2
votes
3answers
6k views

anchor (#) in url alias

I want to open same page from different contents. So I need to generate link like /testimonials#group-1 for these contents. I used pathauto module for this. I made pattern for this category ...

1 2
3
4 5
16