2

I'm looking for a module that will let me limit users to certain domain names when they edit a Link field.

For example, only let users enter a URL if the domain name is facebook.com, twitter.com or plus.google.com.

This list must be easily editable by admins.

Does such a module exist?

(Also: See my other question, if there is some a module that can do both it'll be great)

1 Answer 1

1

You can use the Field Validation module

This module adds an extra tab to each field instance, allowing you to specify validation rules for your field instances.

From there you could a custom PHP function/regular expression to match the URLs against the field value.

This will only editable by admin in the sense that they can also edit the PHP code/regular expressions in the field validation rule. I'm not aware of a specific module that will do everything that you want without any customisation.

3
  • I love running across new modules like this. Thank you for sharing. :) Regex examples to note: regexlib.com/Search.aspx?k=URL
    – Citricguy
    Commented Feb 13, 2012 at 12:17
  • @Citricguy Me too, I wouldn't even have found it had it not been for this question...now off to install it in several sites :)
    – Clive
    Commented Feb 13, 2012 at 12:20
  • I would've preferred a more complete module, but since the clients are willing to get their hands dirty and edit fields, it could work. Thanks!
    – Daniel
    Commented Feb 15, 2012 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.