Do not expand "URL Aliases" fieldset
telega - May 27, 2008 - 18:35
| Project: | Pathauto |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Currently Pathauto expands "URL Aliases" fieldset for users with 'create url aliases' permission. Code, responsible for this:
$form['path']['#collapsed'] = FALSE;
This is a bit annoying, I think user can always manually expand the fieldset if he wants to provide a custom path.

#1
Let's get some more general feedback on this. Anyone else care to state a preference?
#2
Seems it's fine as is.
#3
I don't like it, it takes control away from the developer/user...... we shouldn't have to edit the module just to get something that simple.
A simple setting in pathauto settings page would suffice......
#4
"A simple setting" would make the ui even worse. The ui is already famous for being bad #191509: If transliteration module is not installed, hide the transliteration checkbox so, no, a simple setting is not "simple."
#5
I for one have clients that rarely use the path feature and 90% of the time it is just confusing for them. Even if I need to add
$form['path']['#collapsed'] = TRUE;or$form['menu']['#collapsed'] = TRUE;to my template.php file to have this collapse by default then I should be able to. Everyone wants Drupal to have a simpler UI, but we all know that you can't have everything and nothing at the same time.Currently, complete control over the form elements is not 100% functional. What I typed above does not work and I've yet to find an elegant solution to this. I suppose it could be that I'm on 5.9 or an error on my part but the documentation is sparse on the subject.
#6
marked #295048: Default fieldset collapsed as a duplicate.
jeffleeismyhero - afaik you are able to change this yourself either in a theme function or in a separate module's hook_form_alter (note that you'll need to set it to a heavier weight than pathauto to get that to work...).
#7
This is a very important issue for me. I think most using using pathauto are not manually aliasing (as it defeats the purpose of autoaliasing), so why expand this checkbox by default?
Please change it. I hope I'm not being impertinent by marking this active, I think collapsed is much more intuitive.
#8
I agree with Miraploy. It does confuse users as they think it needs to be filled in because it's not collapsed.
Could anyone point to me to way to do it in a theme function?
#9
once pathauto is installed i usually let him do his job 99% of the times. It would be less cumbersome to leave the fieldset collapsed by default, or at least let admin choose i guess.. here's an article dealing with adding CSS classes to fieldsets, it might be of help meanwhile: http://chirale.wordpress.com/2008/03/17/add-css-class-to-drupal-form-fie...
#10
I think it's more useful to have that fieldset visible; sometimes I need to change the alias set to one I want, and having that fieldset visible avoids me to click on it to make it appear.
People who gets confused seeing the fieldset not collapsed could get confused also seeing it collapsed (also because nothing stops them to click on it, and making it not collapsed).
The confusion is not generated by the fieldset, but from not knowing what it is its purpose; in the case the module has been installed to third party web servers, who installed the module should explain what its purpose is, and what it adds to the user interface.
People should not get confused about the field needing to be set, as the field contains already a value, and it's not marked as required with a red mark.
Also in this case, it seems that the confusion is caused by not knowing exactly the way Drupal works, or the way the module works. If I install a module in my web server, I read the documentation to understand what its purpose is; in the case of somebody installing modules on others' web server, he should also give an explanation of what the module does.
#11
Like said from the maintainer, adding a setting for expanding the fieldset would not resolve the problem, and it would cause more confusion; the confusion is then not generated by the module, by who installed the module that didn't explain what he installed.
#12
my 2cents: why don't collapse it when the path is already created and expand when it's blank? You'll have it expanded on node-creation, and in node-editing you'll have it collapsed...
My 2 cents..
Regards
#13
It's difficult the field is blank, because pathauto.module puts a value on it, whenever the node is being created, or edited.
That could happen if there is not a default value for the node pattern, and there is not a value for the pattern of the content type being edited/created. Who installs the module wants it creates the default alias for the content types; therefore it is more probable that he will set at least a default pattern.
#14
I Mean: when you create a node, in "path" you'll have blank and it's field disabled by "Automatic Alias" checkbox setted. In this case fieldgroup should be expanded. When you edit an already created node, you'll have the field filled up with generated path (still disabled by checkbox) : in this case you should collapse the fieldset.
This allowing users to edit path when creating a node, and further edit it only if you really need to expanding fieldset.
Once again: my 2cents :)
Regards!
#15
I agree with #12 and #14.
Having the Url Aliases fieldset expanded all the time just clutters the page and draws more attention than needed. I have no other fieldset expanded by default (except from Menu Settings which is really annoying as well) since they are optional settings. If a setting in a fieldset is required, there's no doubt it should be expanded by default, anything else would just lead to an irritated "doh!" from the user after having scrolled past the fieldset and hit Save/Preview.
With "Url Alias" it's a different thing, especially if there is already an alias set for the node.
#16
@#14: I don't see any difference between when the node is being created and the path alias is blank, and when the node is being edited and the path alias is not empty. In both the cases, I would want to set my own alias for the node.
It's true that path.module shows that fieldset collapsed when the path alias is an empty string, but pathauto.module adds a checkbox that allows to override the default path alias set by the module with one I choose.
It's preferable that the fieldset is not collapsed, as it evidences that a path alias will be set (even if the text field contains an empty string). If I don't remember that pathauto.module is enabled and I see that fieldset collapsed, I would think that the path alias for the node will not be set, which is not what would happen.
To make an example, the behavior pathauto.module is the same followed by a Drupal core module that shows the Revision information fieldset; that fieldset will not be collapsed when the module adds the Create new revision checkbox.
#17
@16: I see what you mean and if pathauto should strictly follow in core's steps, not collapsing the fieldset would be the thing to do. But what says core does the "right" thing? (Obviously that could be discussed to no end as well, but let's not go there...)
Since there seems to be a great disagreement on things like this, why not leave it up to the end user? Yes it would add yet another checkbox or other element[s] to the settings page. Yes it's cluttered as it is. But hey, it's a really advanced module, wouldn't people expect something like this to come with lots of options?
I'd go for a redesign of the settings instead. Break out things into "variables/change-once-then-leave" settings [where this case would go], and then have another page for "tasks/often-changed-things". Kinda like there are different tabs for viewing the aliases in use and handling them individually, and one for deleting "bulks" of them. Maybe add another tab for bulk updating/recreate them as well? Or perhaps add the option to recreate aliases to the deletion page, and of course rename it to something more appropriate?
Maybe I'm getting a bit off topic here, just trying to widen the perspective a bit to find more alternatives...
#18
This should not be expanded by default. If we are letting path-auto do its job, this just confuses clients more.
#19
FYI this is also fixed in the patch provided in #369840: If a user changes the automatic path, try to remember that in the future.
#20
Should be collapsed.
And one more option in the configuration ui is not a big deal, so I'm for making it an option with collapse by default. I suspect, as others have said, the vast majority using this mod want it to be "auto"... set and forget.
#21
one more vote for default collapsed...
#22
This should be an option in settings. I prefer collapsed by default. Users should never need to change it, so it should be on auto and collapsed to make a page setup more simple, but the option to expand and change is nice to have if required.
#23
At the very least you should be able to override it in hook_form_alter, which currently doesn't seem to be the case...
#24
Overriding hook_form_alter() does work.
Add the following to your custom module (replace [module-name] with the name of your custom module):
<?php/**
* Implementation of hook_form_alter().
*/
function [module-name]_form_alter(&$form, $form_state, $form_id) {
if ($form['#id'] == 'node-form') {
$form['path']['#collapsed'] = TRUE;
}
}
?>
You then need to edit the system table of the database to give your custom module a weight greater than 1 (the weight of the Pathauto module). This will allow your changes to be applied after Pathauto's (Greggles mentioned this in #6 above).
Works for me.
#25
Just moved up to 6x-1.2... and now the line I could hack before to collapse by default doesn't exist.
This one...
$form['path']['#collapsed'] = FALSE;At least, if it's in there, I sure can't find it.
So now, what's the simple way to collapse that fieldset? Hate having it expanded by default.
#26
Have you made sure your module's weight is greater than PathAuto's? See #24 above if not.
#27
This has been fixed with #369840: If a user changes the automatic path, try to remember that in the future and does not alter the behavior of the fieldset provided by the core path.module, which expands the fieldset if there is an alias. If you still don't want this expanded, continue your custom form_alter().
#28
I've read a few places where it says "this has been fixed" but I've got the latest version and I don't see where it's fixed.... I guess if "expanded only if there is an alias" means "fixed," I can see that. Not what I'm after though. Want it unexpanded at all times until a user expands it.
About module having a particular weight... are we saying the only way to fix this behavior now is by creating a module? I don't really know how to do that. Sure would be nice to have it as a config. option.
#29
@aharown07: You failed to understand the most important part about previous comment. Pathauto no longer modifies the fieldset collapsion state. What you're seeing now is the default behavior of core's Path module. You should file a patch against core.
#30
As per previous Dave's comment, I am marking this report as fixed.
#31
OK... got it. Thx.
#32
Automatically closed -- issue fixed for 2 weeks with no activity.