owzim Posted November 26, 2014 Share Posted November 26, 2014 Currently to change the 'summary' description in context of 'basic-page' we would have to do this: // get the template $t = $templates->get('basic-page'); // get the field in context of this template $f = $t->fieldgroup->getField('summary', $useFieldgroupContext = true); // value of the field $f->description = "'basic-page' summary description"; // save new setting in context $fields->saveFieldgroupContext($f, $t->fieldgroup); What I'd like is something like this // get the field $f = $fields->get('summary'); // value of the field $f->set('description', "'basic-page' summary description", $context = 'basic-page'); // save new setting, perhaps optional, because behind // the scenes `saveFieldgroupContext` has been called already? $f->save(); Similar for getting in context: $f->get('description', $context = 'basic-page'); Not only is it more intuitive, but less verbose, in my opinion. What do you think? 4 Link to comment Share on other sites More sharing options...
kongondo Posted November 26, 2014 Share Posted November 26, 2014 I like the idea.. Link to comment Share on other sites More sharing options...
Soma Posted November 28, 2014 Share Posted November 28, 2014 I use this: $fg = $fieldgroups->get("basic-page"); $fields->saveFieldgroupContext($fg->getFieldContext("sidebar")->set("label", "aside"), $fg); 6 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