Jump to content

Change field-label after page save


didhavn
 Share

Recommended Posts

Hey All.
 
I am trying to change the label of a field after a certain page is saved.
This field is not part of the page that is saved but the label should be updated with the page name.

$pages->addHookAfter('saved', function($event) {
	$page = $event->arguments[0];
	if($page->template->name == 'service-type') {
		$cid = $page->id;
		$this->message($cid);
		/* find field servicetype_rangeslider_$cid and set label */
		// how to access $fields??
	}
});

I have this hook in my /site/ready.php. Now my remaining problem is, how to access $fields array or in general, how to get the field?

I am thankful for every hint,

thanks!!

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

×
×
  • Create New...