Sometimes (always?) it's helpful to be able to freelink to a URL alias as well as a title. Indeed, I think in a lot of cases this may be the default? In other words, I may want to have a page (maybe a view, or any sort of page, not necessarily a node) with a title "Foo Baa and some Harry" (or worse, no title at all), and I set up the url (alias) to be /FooBaa. Now I'd like the CamelCase link FooBaa to correctly point at the FooBaa URL.... Ok - ideally I'd love it to be replaced with the title correctly, if one is set (which is not always the case).... but, slowly grasshopper
The following patch is a half-way house. It ignores the (useful) ability to screen off some node types, and just looks up in the alias database..... you may consider doing a better job... but for now, it works for me.
It's patched against 5.x.1.0 (sorry).... But it's a small patch
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | freelinking_204296.patch | 1.03 KB | Christefano-oldaccount |
| #2 | freelinking.module.urlalias.patch | 4.04 KB | markfoodyburton |
| #1 | freelinking.module.urlalias.patch | 3.23 KB | markfoodyburton |
| freelinking.module.urlalias.patch | 2.39 KB | markfoodyburton |
Comments
Comment #1
markfoodyburton commentedSlightly improved patch
This will also make freelinking be more "generous" about what things it links too.
The "rule" is - if the title, or url alias contains the linked word, then it will match. The title or url that is the shortest will match first (in other words "FooBaa and stuff" will match FooBaa, and it will match before "FooBaa and stuff and more stuff".
Titles will always match before url's
Comment #2
markfoodyburton commentedThird time lucky. This includes a patch to the CamalCase handling code as discussed http://drupal.org/node/206711
It also fixes thngs so that the entire path is passed down to the right module to work out if we have a match in the url_alias.
Next up, between url_alias and freelinking, I want to put some ability to say
Foo/Baa/Harry should actually map onto /Foo/zoo/Baa/Harry
(Or arbitrary things like that)
Comment #3
markfoodyburton commentedShould mark this as patch needing work
Comment #4
eafarris commentedCommitted an alternative fix for this as 5.x-1.3-beta1. This will require a bit of testing, but it seems to work here. As a test, I made a node titled "Apple, Inc." and used the path module to alias it to "apple". Subsequent freelinks to [[apple]] correctly brought me to the "Apple, Inc." node.
Please verify and close.
Thanks for the report.
Comment #5
markfoodyburton commentedThanks for this.
I'm afraid I eventually worked out that I was asking for something sill (as per normal).
What I wanted was
[[/my/path/to/foo]]
To match.
But, actually, as I was using this from within pear - it was as easy to simply say to pear - if you see something with "/"s in, then it's probably a path, and just link to that directly. Hence I "short cut" around freelinker.
On the other issue though, still have a problem of freelinking being active inside html markup.... :-(
Did you manage to solve that too?
BTW, for what it's worth, having said all of that, your patch looks good :-)
Cheers
Mark.
Comment #6
Christefano-oldaccount commentedI hate to reopen an issue once code has been committed, but the t() function on line 213 is missing a parenthesis and the module fails to install.
Comment #7
eafarris commentedGrr. Thanks. Fixed in Beta 2.
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.