valan Posted July 29, 2015 Posted July 29, 2015 Q: see topic title As far as I understand there should be at least two ways: - kind of locked Textarea/CKEdit field that is filled with markup being generated from PHP snippet when page is opened in edit mode - some kind of hook that injects markup into the edited page in right place I've checked available modules but haven't found the answer. If this kind of Q has been addressed somewhere before, I would be glad to hear about it!
Macrura Posted July 29, 2015 Posted July 29, 2015 i usually use a custom module and put all of my custom admin stuff there, e.g.: public function ready(){ if($this->page->process == "ProcessPageEdit"){ $this->addHookAfter('ProcessPageEdit::buildFormContent', $this, 'mySpecialThing'); } } public function mySpecialThing(HookEvent $event) { $form = $event->return; $field = $this->modules->get("InputfieldMarkup"); $field->markupText = "<h3>My Special Thing</h3>"; $form->prepend($field); } // end function 4
valan Posted July 29, 2015 Author Posted July 29, 2015 @Macrura: thanks! What if you need to place markup somewhere on the page (e.g. btw some fields)?
Macrura Posted July 30, 2015 Posted July 30, 2015 it depends a lot what the content will be; if it is static info, then i would use textarea markup module if it is something that needs to be dynamic, using javascript/ajax, then i might use the textarea markup but have some custom admin jquery that can read other values/fields and change the content of the text area. for php generated stuff i don't know how to insert it between other fields, using the module code, but there might be a way... you could always put it at the top and then move it with jQuery 1
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