Jump to content

configInputfields template context API usage


interrobang
 Share

Recommended Posts

I am playing around with the new addition getConfigAllowContext()
http://processwire.com/blog/posts/processwire-2.5.7-core-updates/#field-template-context-now-available-for-any-field-property
 
In my InputfieldTest.module I have this method:

    public function ___getConfigAllowContext($field)
    {
        $contextFields = parent::___getConfigAllowContext($field);
        $contextFields[] = 'cropSettings';
        return $contextFields;
    }

In the admin everything works like expected. But I have no idea how to use this with the API.

In my "FieldtypeTest.module" I want to get the cropSettings in the  context of a specific template. Until now I am using $inputFieldInstance->cropSettings to get my settings, but of course this gets me only the value without the context. 

Any ideas?

  • Like 1
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
 Share

  • Recently Browsing   0 members

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