Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I hope it's not a duplicated issue.. Couldn't find any similiar question in the issues list.
Is there possibility to set this field only for external links ?
E.g. to validate if link format is correct. Now when I put 'asd' it creates a link http://localhost/asd .
I want to disable it and force user to put proper link , like 'example.com' instad of 'example'...
Comment | File | Size | Author |
---|---|---|---|
#11 | extlinks_pattern_matching.png | 69.36 KB | gooddesignusa |
#5 | link-external-only-validate-HEAD.patch | 1.91 KB | nasa51 |
#5 | external_link_validation-6--2-9.patch | 1.83 KB | nasa51 |
Comments
Comment #1
jcfiala CreditAttribution: jcfiala commentedHmm. It's not a current issue, but I can certainly see the use in forcing the type of link.
Of course, it would get done quicker if someone could work up a patch!
Comment #2
benone CreditAttribution: benone commentedBy now I just changed line 727
to
Works. :)
Comment #3
wik CreditAttribution: wik commentedsubscribing
Comment #4
wik CreditAttribution: wik commentedsome tags
Comment #5
nasa51 CreditAttribution: nasa51 commentedAdd option on link field setting for "DO NOT accept local links"
Comment #6
benone CreditAttribution: benone commentedis it comitted in 6.x-2.9 ?
Comment #7
benone CreditAttribution: benone commentedvalid_url function is poor
when i put http://aaa it takes it true , but when I type www.aaa.com it shouts at me with the error.
What a pity...
Comment #8
gooddesignusa CreditAttribution: gooddesignusa commentedsubscribing. Any chance on a re roll for the latest dev?
Comment #9
fourmi4x CreditAttribution: fourmi4x commentedI'm so suscribing to this!
There are already two other threads about that topic :
http://drupal.org/node/863396
http://drupal.org/node/831980
It would be awesome to be able to choose for each Link field if we want to accept only internal, only external or both types of links.
Apparently the patch in #5 has not been committed... ?
Comment #10
dqdThe reason for why there's been no patch submitted is obvious: it is a one-way solution which can't be submitted easely to a modul in a MODULAR system with many use cases. Think about a multi-domain Drupal installation, which wants to except internal links for all including domains - Just to count one example. I think this specific feature request will not find its place in this module, as along as there is no better suggestion for a general purpose which can handle this and more than one use case, to prevent goose-chases afterwards.
I darsay, or what I rather could imagine is a pattern field which can be optionally switched between "except only the pattern" or "expect all but not this pattern" (similar to what blocks support). But this will rather be a feature request for a link 7.x 2.0 release. For link 6.x and 7.x 1.0 we have already a code freeze: read here why -> #1269718: Blockers to a 7.x-1.0 release?
Feel free to provide patches here for 7.x 2.x but it will sadly rather committed when 1.0 is finally out. Thx 4 understanding.
Comment #11
gooddesignusa CreditAttribution: gooddesignusa commentedCan we copy the pattern match from http://drupal.org/project/extlink.
Would this work?
screen shot of extlink settings page attached
Comment #12
dqdFolks, please read the project page info of link module carefully. There is already an issue to collect and discuss all possible validation scenarios in general. That's why I will mark this one here as a duplicate. I need all concentration inside the ONE and only discussion to move forward. After a D7 implementation we will provide a D6 backport.
Explanation: There are too many corner cases and validation wishes of users to implement them all serially one after the other. We would have a 40 lines cluttered settings form for validation methods only conflicting each other. I think, the right way is to find a maybe more complex but all embracing configuration method, which lets the admin better decide how and when to validate the url. Including a good description which helps to set it up.
#11, good point! didn't even knew it. But it'S funny that it fits to what I sad on the gathered issue on this topic.
Comment #13
dqdplease use this issue instead to let this go on ->
#1318938: An all-embracing attempt for URL validation and Input / Output Form Filtering
Comment #14
dqdit's rather code component and needs a better tagging to sort issues for field validation