0

I have developed a PyroCMS custom module, but now I want to add WYSIWYG editor instead of the text area.

How can I add it?

Christian Giupponi
  • 7,408
  • 11
  • 68
  • 113
Pramod Kumar Sharma
  • 7,851
  • 5
  • 28
  • 53

2 Answers2

3

Just append this while building the template in the controller.

->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))

and then

echo form_textarea(array('id' => 'body', 'name' => 'code', 'value' => '', 'rows' => 30, 'class' => 'wysiwyg-advanced'));

Hopefully this will help you sometime..

Pramod Kumar Sharma
  • 7,851
  • 5
  • 28
  • 53
1

Update:

With PyroCMS 2.2, $this->data has been deprecated.

In your controller you would need to change

->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))

to

->append_metadata($this->load->view('fragments/wysiwyg', compact('items'), TRUE))
Christian Giupponi
  • 7,408
  • 11
  • 68
  • 113