I want to contribute module named «Handy alias» that provide easy way to attach aliases to vocabularies, terms and nodes. Further this aliases can be used for building structure-corresponding paths with «pathauto» module using this aliases as a parts of the whole path.
This functionality is not so obviously useful for English-language sites, as they use to build aliases based on term/node titles. But for localized sites it's very important to have opportunity for specifying aliases that is not just transliteration of object(term/node) title.
Little example: we have vocabulary «Motor vehicles types»
There we have tree-structured terms like:
- Truck
- Passenger car
---- Hatchback vehicles
---- City vehicle
-------- Micro vehicle
etc…
Also we have content type «Motor vehicles» categorized with this «Motor vehicles types» vocabulary.
And now we want paths of Motor vehicles nodes look like this: autos/pass-cars/city-cars/micro-cars/some-node-alias.html
and paths of terms look like «autos/pass-cars/city-cars»
We can easy realize this needs with «Handy Alias» module with next few steps:
1. Enable «handy alias» for «Motor vehicles types» vocabulary, set «autos» alias for this vocabulary (see http://www.labs42.com/_img/handyalias_vocab_form.png)
2. Set alias for each term of this vocabulary:
Passenger car ---> pass-cars
City vehicle ---> city-cars
Micro vehicle---> micro-cars
Hatchback vehicles ---> hatchbacks
Truck ---> trucks
(see http://www.labs42.com/_img/handyalias_term_form.png)
(again, importance of this ability it's not so obvious when terms named in English)
3. Go to pathauto patterns page and set following pattern for «Motor vehicles» content type:
[vocab-handy-alias]/[term-handy-alias-path]/[node-handy-alias]
[vocab-handy-alias] will return «autos»
[term-handy-alias-path] will return, for say, «pass-cars/city-cars/micro-cars»
[node-handy-alias] will return «some-node-alias.html» or node id if node alias if empty.
Also «Handy Alias» module allows specifying node aliases, if this feature is enabled for content type. Handy alias feature setting for content type: http://www.labs42.com/_img/handyalias_ctype_form.png
Specify handy alias for node: http://www.labs42.com/_img/handyalias_node_form.png
I haven't found any similar modules, so I hope Drupal community will find it useful.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | handyalias_0.0.3.zip | 8.26 KB | Stutzer |
| #5 | handyalias_0.0.2.zip | 8.07 KB | Stutzer |
| #4 | handyAlias_0.0.1.zip | 8.07 KB | Stutzer |
| #2 | handyAlias.zip | 8.27 KB | Stutzer |
Comments
Comment #1
avpadernoHello, and thanks for applying for a CVS account.
As per instructions, the archive containing the module needs to be attached in a comment here; without that, this CVS application cannot continue.
Comment #2
Stutzer commentedHandy Alias module source code
Comment #3
avpadernoComment #4
Stutzer commentedSome improvements:
* Fix dependencies
* Some minor fixes
Comment #5
Stutzer commented* Several tiny bug fixes
* Some comments
Has anyone tried to use it? Any comments?
Comment #6
avpadernoDeleting Drupal variables using a query that matches any Drupal variable with a name that starts with the module name would remove also the Drupal variables of other modules.
There is a Drupal function to use to load PHP files.
It usually not a good idea to unconditionally include code contained in PHP files. If the files contain form handlers, theme functions, or menu callbacks, Drupal core code allows to third-party modules to define which files must be loaded in the implementations of
hook_menu(), andhook_theme(); in these cases, Drupal loads the file only when necessary.It should be vocabulary.
Why isn't the code using
drupal_set_message()?It should be allowed.
The character
`is not used from all the database engines for which Drupal is compatible.Comment #7
Stutzer commentedkiamlaluno, thank you very much for your review!
Fixed all your points and made some slight improvements.
Also reviewed code by coder module and fixed almost all coding-standards deviations.
Comment #8
avpadernoI will review the code tomorrow.
Comment #9
avpadernoshould be
As per coding standards, there should not be any spaces after an open parenthesis.
The placeholder for URLs must start with
@.Thank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank all the dedicated reviewers as well.
Comment #10
Stutzer commentedThank you, Alberto!
Reading about CVS rules, project maintaining etc. and publish my module.
Comment #13
avpadernoComment #14
avpaderno