65 Posts
Wissner
5 years ago
2
Topic

Hi,

is there any plugin to make a field optional/required depending on the access level of the user?

Explanation:

I created a rather complex content type. Its almost finished. The content can be saved by authors and publishers, but only publishers can publish the content.

There are a lot of required fields in this content type, and also a lot of conditions between fields. 

Now my customer wants that for authors all fields are optional. They should be able to save the content, even if required fields arent filled.

But for publishers the required fields should be required. 

I understand why they want this. It makes live easier for the authors. But if I start creating a second field for all required field, which is optional, and which is only seen by the author, and the required fields are only visible for the publisher, I will start a big task.

For there are a lot of conditions between these fields, and it will be quite difficult, to build these conditions for the second fields without creating any bugs.

Thanks for any hint.  :-)

Wolfgang


Get a Book for SEBLOD
1283 Posts
Bucklash
5 years ago
0
Level 1

This isn’t a plugin but a solution to sonething similar was to have a free text field called “publisher” with a value “1”

Have access set to “publisher”

In art_state field have a condition that says “is enabled when publisher equaks 1  (or condition like that, can’t remember right now)

65 Posts
Wissner
5 years ago
0
Level 1

I desided to create my own solution for this. Most of the required fields are set to optional, only title is set to required.

When the user is logged in as publisher, all required fields get a class "validate[required]". Then javascript recognizes this field as required and refuses to save, if it is not filled.

Thanks

Wolfgang

Get a Book for SEBLOD