Jump to content

RockOptionsApi - easy manipulation of option-fields via API


Recommended Posts

Have you ever had a hard time setting the values of an options field via API? Grab RockOptionsAPIĀ šŸ˜Ž



ProcessWire module for easy manipulation of option-fields via API



Readonly options field renderer

By default options fields that are set to readonly via theĀ lockedĀ collapse state only show selected options and hide other available options. That might not be what you want. Here is an alternative that turns this:


Into that:


Simply callĀ $form->readonlyOptions('yourfield')Ā in the ProcessPageEdit::buildForm hook or when using MagicPages in theĀ editForm()Ā method:

$wire->addHookAfter("ProcessPageEdit::buildForm", function($event) {
  $form = $event->return;
  • Like 5
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...