Jump to content

CKEditor for module config


Inxentas
 Share

Recommended Posts

Hi there! I'm writing a module for a website, and it needs to store a bit of text. This works fine:

$inputfields = parent::getInputfields();
$message = $this->modules->get('InputfieldTextarea');
$message->attr('name', 'message');
$message->label = 'Message';
$message->required = true;
$message->set("inputfieldClass", "InputfieldCKEditor");
$inputfields->add($message);

...except the part about the inputfieldClass. Is it possible to make these fields have a "CKEditor" instead? My client would need to add a little markup.

Link to comment
Share on other sites

Just use InputfieldCKEditor directly instead of InputfieldTextarea. You're talking about direct application of Inputfields here. The inputfieldClass needs to be set if you are attaching a field (a FieldtypeTextarea, not InputfieldTextarea) to a template for use in pages.

Link to comment
Share on other sites

You're welcome. You can set the useLanguages flag on the CKEditor field to get multi language support.

$message->useLanguages = true;

The only thing you need to aware of is that, as far as I know, there is no fallback to the default language's value if the value in the current language is empty.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...