LostKobrakai Posted September 2, 2014 Share Posted September 2, 2014 Hi, is there an easy way to get PageTables to render wysiwyg content instead of displaying the markup. Or at least hide the markup. Link to comment Share on other sites More sharing options...
elabx Posted December 31, 2016 Share Posted December 31, 2016 Is there and update for this question?? Link to comment Share on other sites More sharing options...
Robin S Posted January 4, 2017 Share Posted January 4, 2017 On 1/01/2017 at 7:26 AM, elabx said: Is there and update for this question?? HTML renders fine for CKEditor fields. For text or textarea fields there are two possibilities: Strip the tags... $this->addHookBefore('Fieldtype::markupValue', function($event) { $field = $event->arguments('field'); $page = $event->arguments('page'); $value = $event->arguments('value'); if($field->name == 'my_field' && $page->template->name == 'my_pagetable_template') { $event->arguments('value', $this->sanitizer->textarea($value)); } }); ..or decode entities (being mindful of potential security risks that this opens up)... $this->addHookAfter('Fieldtype::markupValue', function($event) { $field = $event->arguments('field'); $page = $event->arguments('page'); if($field->name == 'my_field' && $page->template->name == 'my_pagetable_template') { $event->return = html_entity_decode($event->return); } }); 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