Rich Text Editor in profile

Permalink
Our administrator should be able to edit a specific attribute with the rich text features, however, front-end users should see a plain text area.

What would be the best way to do this?

I saw in models/attribute/types/textarea/ a type_form.php but I'm missing a view.php.
E.g. I'd like to use $ak->render('view_limited'), but simply don't know how :)

Any thoughts?

A3020
 
A3020 replied on at Permalink Best Answer Reply
A3020
Found it!

Steps:
- copy controller to /models/attribute/types/textarea
- copy 'form' method and rename e.g. to 'form_plain'
- make 'view' file, e.g. 'composer_plain.php'


View:
<?php defined('C5_EXECUTE') or die(_("Access Denied."));
echo $this->controller->form_plain();



Controller:
public function form_wg($additionalClass = false) {
      $this->load();
      if (is_object($this->attributeValue)) {
         $value = $this->getAttributeValue()->getValue();
      }
      // switch display type here
      $this->akTextareaDisplayMode = 'text';
      print Loader::helper('form')->textarea($this->field('value'), $value, array('class' => $additionalClass, 'rows' => 5));
   }