1

I want to restrict the users from creating contents with certain title. I require the following functionality.

Example :

  1. Prevent users from creating a content with title, say ABCD
  2. Prevent users from creating a content which has the words, say ABCD in the title.

Is there a module for this purpose. I'm new to drupal and I searched drupal.org but couldn't find a module. Thanks in advance

2

I would look into using a combination of automatic nodetitles, field_validation and clientside validation. Basically once you have those three installed you can create a new text field on your content type which you will use as the title. In the validation settings for that field you can then set it up to not accept certain rules (see this post). Under the edit section of the content type you can set auto nodetitles to use your new field (and hide the title field) as your title.

| improve this answer | |
1

Module Approach

The Field Validation module may be able to help you validate titles and content.

Module Setup Details

Create a Black List

You could add a new 'blacklist' of words against a field if you have a specific list. This would knock out the use of ABCD as noted in both cases you listed above.

Use REGEX

You could use REGEX to validate against one or both of the cases you listed above.

Lullabot has some good introductory information to this module as well.

Advanced

If you're looking to get your hands dirty you could add a validation function to any form using hook_form_alter().

You can use the Form API Quickstart Guide as an intro into custom validation. Specifically, see the Validating Forms section.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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