Closed (won't fix)
Project:
Pathauto
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Feb 2008 at 16:12 UTC
Updated:
4 Feb 2016 at 09:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gregglesWhy not? That's what usability experts and SEO folks say is the best thing to do.
See http://drupal.org/node/215785 for more discussion.
Comment #2
isaac77 commentedThanks for your response! i agree that _in general_ usability and SEO considerations mean that duplicate content at multiple urls is a bad idea. However, in this case we really do need to have content available at 2 distinct locations. (Won't bore you with the details...)
I may have to work around this by using views to display the nodes, but i would be able to avoid that mess if pathauto could accommodate the creation of multiple paths for 1 node. Let me know if you think there is a way to do this... Thanks again!
Comment #3
isaac77 commentedComment #4
gregglesPathauto can't currently do this. I don't plan to add it.
Comment #5
gregglesOf course, certainly could write code for this, but it would take a lot of campaigning (i.e. other people saying they really need it) for the idea to be committed.
Comment #6
isaac77 commentedthanks again. i'm moving this 'feature request' for 6.x version.
if anyone else would like to see this functionality, please chime in. of course you're right--if there isn't widespread need for this, no reason to implement.
one note: if duplicate content is not widespread (i.e. the feature i'm asking for is only used on a small proportion of nodes on a site), SEO considerations may not be much of a problem at all.
Comment #7
gregglesYes, but...in the post that I marked this a duplicate of I mentioned how this is a problem of usability, SEO, and also the user interface. Setting two aliases per node requires an increasingly complex user interface and Pathauto is already famous for having a "airplane cockpit" of an interface. So, the trick is providing this option without making the interface even more complex.
Comment #8
kenji_kun commented+1 suscribe
In Drupal 6 you can define per language path aliases.
Pathauto this is the next step.
Comment #9
litwol commentedgreggles,
i will work to do some ajaxy solution where you can click a (+) button and it will make available another input field for you to type aditional pattern. not sure if i'll be able to do this for D5, but i could surely do this for d6.
here is an example of how i do it programaticaly
Comment #10
snufkin commentedits not just a question of having an extra field for a second (third ...) alias, but rather the ability to assign all the permutations of the given token set.
For example I have a multiselect vocabulary (yellow and red as terms) on a node, and i want the node to be displayed under both terms:
content/[term]/[title]
would result in
content/yellow/[title] and content/red/[title].
This would need some smart automatic alias assigning.
Comment #11
greggles@snufkin - that is definitely a related feature, but note that it also requires something like #185446: Provide tokens for each vocabulary (which needs help).
Comment #12
litwol commentedi wonder how something like this will be accomplished in d6 menu system? can it be done using menu placeholders ? %?
as for d5 my guess is that there will be a need for something like [map-term] or [loop-term] to tell pathauto or other responsible module to loop through all possible choices of the current term vocabulary or something.
i am just theorizing as i dont have time to spint out any code just yet.
Comment #13
snufkin commented@greggles: thanks for the pointer. Right now we need this feature for a project, so i will work on it, hopefully will result in a working patch.
@litwol: my plan so far (before reading the token issue) was that when
$placeholders = pathauto_get_placeholders('node', $node);gets called we create a placeholder array which contains not just single items, but sometimes arrays. This would require adding some smart functionality into pathauto_get_placeholders(), checking the node object, and creating an array out of the terms if necessary.After this is done in the pathauto_create_alias we would only check if there is a subarray in the $placeholders array, and if there is we loop through that and do the str_replace.
I know this is a very rough plan, I will probably work on this whole day tomorrow, so if you have any tips for how to attack the problem I would be very glad.
oh and we're working on Drupal 5.
Comment #14
snufkin commentedim now experimenting with a way of adding a
['term-multi-raw-?']style token. the values are calculated either in token, or just pluggable from an external module using hook_token_values by checking the$node->taxonomy, and assembling the term path accordingly (for example comma separated list, so i just need to replace it with the '/' separators).for this to work i still need to make the pathauto aware that if there is a ? in the token settings that means to expect numbers, and proceed accordingly (in my case create multiple paths).
i am not entirely sure if this is the correct approach, but seems sensible since it doesn't involve adding subarrays into the token/values list.
Comment #15
litwol commentedhow will it handle paths like [vocabulary-multiple-raw-?]/[terms-multiple-raw-?] ?
will this create correct vocab / term hierarchy of paths or ...?
Comment #16
snufkin commentedThe approach can do that (but im afraid its a bit hackish). the trick is to assemble the path in token using the hook_token_values, and adding the key into
pathauto_clean_token_valuesso your path "/" is not stripped out of the string.This is (or at least part of it) the code i added
And from here on i have to treat $alias as an array. the
_fuzzy_search_multi()is just a helper function to cut me out the part from the$placeholders['tokens']array that i need.edit weird, php filter things ?]'; is the same as ?>
Comment #17
litwol commentedI am not sure, but why do we need the question mark? what is it's purpose?
Comment #18
snufkin commentednothing specific, it just marks that the actual token will have a different ending
Comment #19
litwol commentedunless i completely miss the issue at hand (regarding the question mark) i will strongly object against using something as cryptic as that.
Comment #20
snufkin commentedthats just a proof of concept kindof thing. There is already something like that, the mod- token:
[mod-????]
All tokens for node creation dates can also be used with with the "mod-" prefix; doing so will use the modification date rather than the creation date.
i will write up a patch soonish, so you can actually see what i meant, maybe this is not the way to go at all.
Comment #21
snufkin commentedso this is my take on this issue, patch against DRUPAL-5--2. It provides a token called [multi-term-path-raw], to be used in configuration when one wants to save the taxonomy hierarchy in the URL, and wants the same node appear under all the subcategories:
example node 3
Taxonomy its filed under:
now for path [multi-term-path-raw]/[nid] this patch generates the following aliases:
<parent term>/3<parent term>/<child term>/3<parent term>/<child term>/<grandchild term>/3The patch is highly experimental, its more like a proof of concept. Normal alias generation might be broken due to the untested nature of this patch.
Two files are changed:
* pathauto.module, in which the token and its value are handled
* pathauto.inc has changes in the alias generation (detects the multi... token in the path and uses a new multiple alias creator function)
Comment #22
snufkin commentedRealizing that the actual token definition and value can come from an external module (tested), here is a reroll, without the pathauto.module modification.
Comment #23
snufkin commentedsome smaller cleanups, i have so far tested with my module that provides the token, and works just fine, updating aliases works too, however old aliases are not deleted, because I don't know how to differentiate between an automatically created alias and a handmade one.
Comment #24
d.clarke commentedI just wanted to chime in and say that the patch snufkin is proposing would be really useful. Early in the thread it appears to be debatable whether the proposed change will be committed... has a decision been made yet?
Comment #25
paganwinter commented+1
Comment #26
asak commentedThis issue seems stuck.
Another use case: I'm investigating the option of using a single-node product for ubercart, which will serve multiple languages. I'm not going to go into that, and for the sake of this discussion i'll just say i found it to be easier to solve a multilingual ubershop by finding a way for a single node to serve multiple languages then finding a way for multiple product nodes act as a single product as far as ubercart is concerned.
So - say i found a way to display specific content of a node according to the requested language, i still need to have multiple paths, one for every language, to the same node.
This node will also have a title for every language, and it would be best if pathauto could "do-it's-thing" using this language specific info. pathauto integration would mean developing a module which would make pathauto treat every such set of node parts (title, body, cck, etc) as a language, just like it does for language specific nodes, and then pathauto itself would not need to be changed at all.
Just my thoughts... ;)
More info if interested:
http://www.ubercart.org/forum/internationalization/10878/i18n_issues_i_d...
http://drupal.org/project/language_sections (and http://drupal.org/node/313770)
Comment #27
xwalox commentedi need to multiple paths for a node, also load it from views depending of term path
how can we build it?
Comment #28
momper commentedsub
Comment #29
Jurgen8en commentedsub
To be clear, I want to accomplish:
/de/schlusselfinder -> de/node/72
/nl/sleutelvinder-> nl/node/72
Thanks asak, for your reply.
Comment #30
Jurgen8en commentedPS. I know, I´m going to do some ugly changements.
First I did the following.
Changed drupal_lookup_path() in path.inc.
To also look after an alias like: nl/sleutelvinder
I included the two aliasses:
/de/schlusselfinder -> de/node/72
/nl/sleutelvinder-> nl/node/72
Now, I need to change pathauto to generate these multiple aliasses automaticly.
The title translations comes from some cck-fields.
Comment #31
Jurgen8en commentedExecuted the latest patch in this issue.
pathauto.module
added some code to function pathauto_token_values($type, $object = NULL) {
This generates:
/de/schlusselfinder -> node/72
/nl/sleutelvinder-> node/72
Comment #32
dave reidAck I don't think we should be displaying multiple path fields for users. This is horrible for usability, module complexity, and best practices.. Users should understand it's best to have one path to a node. I do however support adding a table listing all the aliases pointing to a node. Maintainers are completely free to override me on this, but I just don't see this happening.
See
http://drupal.org/project/showaliases
#645894: Combine with Pathauto
Comment #33
Jurgen8en commentedRead my previous posts (remember this is a horrible solution)
Updated code of
function pathauto_token_values($type, $object = NULL) {
Comment #34
hnln commentedsubscribe,
looking for a way to have single node (no language) have different aliasses for each language. For example when having an image content type, in dutch I want them to be available by beelden/[title] and in english images/[title].
Comment #35
momper commented@HnLn
i'm looking for the same - do you know, if is there another issue for this? or should we open one?
greetings momper
Comment #36
isaachorton commentedEDIT - I'm using pathauto 6.x.1.4
Has anyone solved this?
I have a desperate need to associate multiple aliases to single nodes of content.
In my case I have a content type called press_release. I want to be able to create a single press release node with a menu link in primary links to:
/company/press-releases/press-release-title
However I also want the following aliases to work:
/section1/press-releases/press-release-title
/section2/press-releases/press-release-title
What I would like to accomplish would be to add a single press-release and have the additional path aliases created. so that each section acts as a complete mirror of the content.
The listing page for each press releases section are required to be section-dependent so that they link to the particular section's single press release(node).
there is a usability confusion issue which is why I need the duplicate content.
I havent found the solution yet that makes sense to me. Something that goes in template.php maybe?
Anyone have a suggestion?
Comment #37
gregglesThere is some work in Pathauto for 7.x that would allow us to do this without making the UI hell, but until that happens this issue is postponed. #273104: Using "progressive disclosure" for alias patterns.
Comment #38
dave reidUm, I thought we were *never* going to support more than one alias per path in pathauto? Hence the won't fix. We can make it possible for that to happen, but it's not pathauto's place to encourage it.
Comment #39
gregglesYeah, I was mostly ready to go back to "won't fix" but I feel like we can consider it with the new UI.
My major complaint is that it makes the UI horrible. If people want to mess up their SEO..so be it.
Comment #40
dave reidI still don't think it's really possible with the UI I have planned. It's just going to complicate things way too much.
Comment #41
jerrac commentedI'm currently working on a project that would benefit greatly from this feature.
So, I'm subscribing...
Comment #42
dave reidI'm going to go ahead and mark this won't fix because we shouldn't be supporting this in Pathauto.
Comment #43
solide-echt commentedJust stumbled upon this thread.
IMHO a better approach to have multiple url's access a single node is to build a view that displays the node and provide arguments in the view that are used in the path. With this approach you can obscure the "real" path of the node from the user. It should also be possible to provide a canonical url for the node, hence SEO should be kept intact.
Comment #44
momper commented+1
Comment #45
yngens commentedHere is quite legitimate use case. I'm trying to sep up a dictionary site on Drupal and need to make some nodes to be accessible by different forms of the words. Like it is done on dictionary.com. For example, all the following urls point to the same content:
http://dictionary.reference.com/browse/compute
http://dictionary.reference.com/browse/computable
http://dictionary.reference.com/browse/computably
http://dictionary.reference.com/browse/computability
http://dictionary.reference.com/browse/computist
Only top part changes, however they all go to http://dictionary.reference.com/browse/compute
Would be nice if pathauto left the number of possible aliases per node to the user. I believe CEO consideration should not limit very logical development path for this excellent module.
Comment #46
gregglesMaybe it's a legitimate case for you, but Pathauto will not do it in the near term. It would create UI complexity that would benefit a small group and harm a large group.
Comment #47
jerrac commentedSounds like it might be a good idea to make a separate module that adds the functionality to Pathauto.
*adds idea to list of things to look into*
Comment #48
yngens commentedIt has just came to my mind that for URL path settings on node edit page is responsible the core path module, not pathauto module. So transferring this issue to the core to request a new feature for the path module.
Is it possible for path module to provide definite or limitless number of fields for setting path aliases per node?
Considering that it is possible to add indefinite number of aliases through the module's administration page, why not to provide the same functionality through UI on node edit?
Comment #49
yngens commentedForgot to make the issue active for the core path module.
Comment #50
gregglesPlease open a new issue for that.
It should be against Drupal 8.
Comment #51
yngens commentedI did. Interested, please, follow http://drupal.org/node/1023804
Comment #52
owntheweb commentedChiming in. I apologize as this turned into a novel...
I'm working on a large site, combining what used to be a lot of separate floaty websites under the same organization roof.
While merging, each program section is still quite large, has it's own sub-theme and for user convenience a media section is available for each program with news and such for that specific program. At the base level a master media section covers media for all programs (the "home" of all media contents).
Sitemap preview (program media sections circled, main media section in bold red):
http://www.flickr.com/photos/8139783@N08/5998496542/
If users jump from program media views to the main media section to view a node, the sub-theme and program navigation gets lost. It has a jolting effect on the user experience.
Personal gut feeling: Only have one alias and users can deal with the theme/nav jolt. - I could add a back link at the top and bottom of the post to soften the blow. SEO rules.
Customer oriented feeling: Offer added aliases for program media sections to keep nav and theme intact when viewing nodes (theme, blocks, etc. based on consistent structured aliases) - maybe I could add a noindex tag for those aliases?
Possible solution: I could create a "multipath" module (got the idea after watching the 5th Element - "multipass!"). It would manage multiple aliases (still working out how to go about this for general public use) and place noindex metatags on the non-pathauto aliases. I don't see my solution as being included in pathauto as it seems so custom-need.
What are your thoughts?
Thanks for the feedback. :)
Comment #53
gregglesIf you need to do this I suggest you depend on Pathauto and leverage it's functions.
I built a similar site last year and we used the user's session to control the theme. The PURL module is also meant to provide that kind of feature without requiring multiple Drupal aliases (though it does have the multiple urls = bad for SEO drawback).
Comment #54
owntheweb commentedgreggles,
I like the user session variable idea. I guess I could reset a "program" session variable when visiting media listing pages (e.g. news briefs, press releases, photo galleries, videos and similar main media categories). That way if someone visits the Research and Analysis News Briefs page, clicking on an article would keep the URL SEO happy and theme/nav elements intact somehow.
I noticed on the PURL project page mentioned maintaining info using session variables like this is "hackish". Is that a bad thing? :)
Comment #55
phponwebsites commentedI want to access page content/article-title/value1, content/article-title/value2 and content/article-title. Is it possible? If yes, the how can do this?
Comment #56
NirmalaGuru commentedrecently I came across a task in my application, Where i had to select taxonomy terms as checkbox and i had to create multiple url aliases with all the taxonomy term name on submission of node,like term_name1/title, term_name2/, term_name3/title.... here is the code which helped me, hope it helps others too....
Comment #57
phponwebsites commentedFinally, I got the solution for set up multiple path alias for a node in drupal 7 using pathauto module. Please visit http://www.phponwebsites.com/2016/08/drupal-7-pathauto-multiple-url-alia....
It will be helpful.