KenedoProperty Type Translatable

PHP class: KenedoPropertyTranslatable
Recommended column type: No need, data is stored in a separate directory

Translatables manage strings and admins will have an input field for each language that is activated.

Multi-Language is possible on Magento 2 and Joomla. Store (Magento) or Content Languages (Joomla) need to be set in the CMS and in CB Settings you select the ‘Active Languages’. See Languages.

Display of Translatables in edit forms:

Typical property settings:

$propDefs['title'] = array( 'name'=>'title', 'label'=>KText::_('Title'), 'type'=>'translatable', 'langType'=>1000, 'positionForm'=>1000, );

Type specific settings:

langType

Required: Yet
Valid values: Integers >= 1000

langType is an internal identifier for the translations for this property. Pick a unique number across your customizations. Use a number above 1000, built-in properties are all below 1000.

stringTable

Required: yes - Obsolete with CB 3.3.3 (Joomla, WP) and CB 3.3.11 (Magento 2) and higher
Valid values: Must be set to ‘#__configbox_strings’

options

Required: no
Valid values: string

  • Use 'USE_HTMLEDITOR ALLOW_HTML' to display the property as HTML editor.

  • Use ‘USE_TEXTAREA’ to display the property as multi-line text field (textarea).

$propDefs['description'] = array( ... 'options'=>'USE_HTMLEDITOR ALLOW_HTML', ... );

 

Property data

When you use your model’s getRecord() or getRecords() methods, then you have the values available by name of the property.

Example:

Property name: title,
Record object var: $record->title (Translation depends on parameter $languageTag in getRecord/getRecord). Also you have each language’s translation in $record->title_en-GB ({property_name}_{locale}). Mind the dash in the locale.