This patch adds a checkbox under each node pattern to disable pathauto completely for that node type. It isn't very pretty and is basically proof of concept. Also, while writing this patch I realized that you can accomplish basically the same thing by deleting the default pattern and not specifying a pattern for a particular node type. But if you have alot of different node types this patch will allow you to continue to take advantage of the default pattern.

Any comments? I'm not even sure if this functionality *should* be merged upstream, like is it useful/desirable?

I'm using this because I want a certain node type to have its aliases auto-generated by a special module, so that its aliases can be drastically different, but I still want pathauto to generate aliases for all the other "normal" content types.

If it is useful and desirable, I'm sure my patch isn't acceptable as-is. There is probably a better way to inject this into pathauto and I know that the UI on the admin/settings/pathauto page could be improved. So, advise of this nature is welcome too!

Thanks!

Comments

dsnopek’s picture

Status: Active » Needs review

Forgot to set the status to "patch"!

greggles’s picture

I don´t really like this idea. As you point out it doesn´t provide any new functionality, but it does double the amount of UI cruft for that section of the form. So, I am tempted to mark this won´t fix but will give it a little while for other people to present alternate points of view (they will have to be really strong, though, and will have to come from someone who is famous as a usability expert who can provide some guidance as to why this makes sense).

dsnopek’s picture

I pretty much agree with you, actually. ;-) The only case this would be really useful is if someone wants to have a default pattern for everything and just one pattern disabled. But then your only saving them the initial setup of copy-and-pasting that pattern into a bunch of text boxes. Not really worth hitting *everybody* with all those checkboxes.

It would be good, however, to document that having an empty default pattern is allowed. I didn't even think to try this until after reading the code! Or is it documented somewhere already and I missed it? Thanks!

greggles’s picture

Component: Code » Documentation
Category: feature » task
Status: Needs review » Active

Ok. I hope that's not to discouraging that this won't get included. I do _very_much_ appreciate folks who post new ideas and especially when they include patches for them!

About the documentation...I don't think it is documented anywhere. Could you propose some help text? I'll be very happy to add that into the README.txt if you can help come up with it. I've changed the component and category to match this new purpose.

Thanks.

dsnopek’s picture

Not discouraging at all! Writing the patch turned out to be very productive because it helped me learn how to accomplish what I wanted.

This could make sense as a FAQ-style entry:

Q: How can I disable Pathauto for a specific node type?
A: If the default pattern is left blank, Pathauto will be disabled for any node types with blank patterns.

Or maybe it could be summed up in a description of the default pattern:

When the pattern for a node type is left blank, the default pattern will be used. But if the default pattern is also blank, Pathauto will be disabled for that node type.

Maybe one of those is helpful?

greggles’s picture

Title: disable pathauto per node type (patch inside!) » documentation for disabling pathauto per node type
Status: Active » Fixed
StatusFileSize
new1.72 KB

Great - that seems good. Added to README.txt

Thanks dsnopek.

greggles’s picture

Also added to the handbook under "Pathauto Pattern Recipes"

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.