Jump to content

Use FieldtypeTextLanguage in module config inputfield


Gayan Virajith
 Share

Recommended Posts

Hi community,

I am trying to create small module with one configurable input field. I would like to know whether configurable input field supports multi-language feature. 

I tried following way but no luck. 



public static function getModuleConfigInputfields(array $data) {
$inputfields = new InputfieldWrapper();

// ask static banner content
$field = wire('modules')->get('InputfieldTinyMCE');
$field->set('type', wire('modules')->get('FieldtypeTextLanguage'));
$field->name = 'bannerBody';
$field->label = "Banner content";
$field->description = "";
if(isset($data['bannerBody'])) $field->value = $data['bannerBody'];
$inputfields->add($field);

return $inputfields;
}


Please advise. Thanks ProcessWire & friendly community.

Link to comment
Share on other sites

Is the mbstring extension for PHP loaded ?

// If this function tells something like: Unknown function 'mb_strlen'
// Then multibyte support is not funtioning/enabled

<?php mb_strlen("test"); ?>

Why the hell they have invented tabs in browsers ? :P  This answer belongs in an other tab and in an other other topic :-)

(dumb me)

Edited by Martijn Geerts
  • Like 1
Link to comment
Share on other sites

This has come up already...

Module config doesn't work with language fields. Since its stored as json and you are actually using inputfields here not fields. Look at LanguageSupportPageNames how it can be done.

Apart from that your code would be wrong. It's InputfieldTextareaLanguage with inputfield type InputfieldTinyMCE.

  • Like 1
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...