dotnetic Posted October 11, 2019 Share Posted October 11, 2019 How can I set the access toggles for a field I create via API? $f = new Field(); // create new field object $f->type = $this->modules->get("FieldtypeFloat"); // get a field type $f->name = 'price'; $f->precision = 2; $f->label = 'Price of the product'; Maybe @ryan can help? Link to comment Share on other sites More sharing options...
dragan Posted October 11, 2019 Share Posted October 11, 2019 Probably with setting the right flag. If I check both access toggle checkboxes and analyze it in Tracy, I see this: flags => "access access-api access-editor system-override (32992)" Here are all possible flags: https://github.com/processwire/processwire/blob/master/wire/core/Field.php#L52 2 Link to comment Share on other sites More sharing options...
dotnetic Posted October 12, 2019 Author Share Posted October 12, 2019 Thanks. This was also answered here: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now