Jacek Posted July 30, 2018 Share Posted July 30, 2018 I'm coding my first module now. I've just managed to add a button to the page edit form but am not content with its placing. Is there any way to place it just next to the input field? I've marked the desired place with the arrow on the attached screenshot. My current code: $this->addHookAfter('ProcessPageEdit::buildFormContent' , $this, 'addButton'); public function addButton($event){ $form = $event->return; $f =$this->modules->InputfieldSubmit; ... $form->insertAfter($f, $form->get("bgg_id")); } "bgg_id" is the name of the targeted field. Link to comment Share on other sites More sharing options...
elabx Posted July 31, 2018 Share Posted July 31, 2018 Hook it in your in the inputfield's render's method: $this->addHookAfter('InputfieldText::render', $this, 'addButton'); In the addButton method, check for the field's name, so it doesn't render everywhere. Link to comment Share on other sites More sharing options...
Jacek Posted July 31, 2018 Author Share Posted July 31, 2018 Sorry, but I still don't know how to do it. 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