interrobang Posted November 1, 2014 Share Posted November 1, 2014 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? 1 Link to comment Share on other sites More sharing options...
adrian Posted November 1, 2014 Share Posted November 1, 2014 I haven't tested, but from memory, I think this is what you need: $t = $templates->get('basic-page'); $f = $t->fieldgroup->getField('fieldname', true); echo $f->cropSettings; Link to comment Share on other sites More sharing options...
interrobang Posted November 2, 2014 Author Share Posted November 2, 2014 Thanks Adrian, thats what I tried before. At least I thought so. Tried it again, and now it works. 1 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