Skip to main content
Version: 4.0 preview

Property type articles

Version
4.0 preview
Updated
View markdown

One article per Kenedo property type. Start with the overview — it carries the settings every type accepts (name, label, positionForm, required, invisible, appliesWhen, options, …), the storage kinds, the storeExternally mechanism and a "which type do I want" table. None of that is repeated here; each article covers only what is specific to its own type.

Storage keys (dataType, nullable, unique, maxLength) are in com_configbox_property_definition_settings.md.

Every article opens the same way: a sentence on what the type is for, its storage kind and column, a note on when to reach for it and when not, then its own settings and its traps.

Each type below carries a compact, illustrative definition — the shape you would put in a model's getPropertyDefinitions(), trimmed to the keys that characterise the type. The article has the full story.

Text and numbers

string

$propDefs['code'] = array(
'name' => 'code', 'type' => 'string',
'label' => KText::_('Currency Code'),
'required' => 1, 'unique' => true, 'dataType' => 'varchar(10)',
);

number

$propDefs['multiplicator'] = array(
'name' => 'multiplicator', 'type' => 'number',
'label' => KText::_('Multiplicator'),
'numberType' => 'decimal', 'required' => 1,
'dataType' => 'decimal(10,5) unsigned',
);

datetime

$propDefs['created_at'] = array(
'name' => 'created_at', 'type' => 'datetime',
'label' => KText::_('Created'),
'default' => null, 'invisible' => true,
);

json

$propDefs['snapshot'] = array(
'name' => 'snapshot', 'type' => 'json',
'label' => KText::_('Snapshot'),
'rows' => 10, 'dataType' => 'longtext',
);

Choices

$propDefs['status'] = array(
'name' => 'status', 'type' => 'dropdown',
'label' => KText::_('Status'),
'choices' => array('draft' => KText::_('Draft'), 'live' => KText::_('Live')),
'default' => 'draft',
);

radio

$propDefs['mode'] = array(
'name' => 'mode', 'type' => 'radio',
'label' => KText::_('Mode'),
'choices' => array('b2c' => 'B2C', 'b2b' => 'B2B'),
'default' => 'b2c',
);

boolean

$propDefs['is_featured'] = array(
'name' => 'is_featured', 'type' => 'boolean',
'label' => KText::_('Featured'),
'default' => 0,
);

published

$propDefs['published'] = array(
'name' => 'published', 'type' => 'published',
'label' => KText::_('Active'),
'default' => 1, 'positionList' => 80,
);

multiselect

$propDefs['customergroups'] = array(
'name' => 'customergroups', 'type' => 'multiselect',
'label' => KText::_('Customer Groups'),
'tableOther' => '#__configbox_customergroups',
'keyOther' => 'id', 'displayColumnOther' => 'title',
'xrefTable' => '#__configbox_xref_discount_customergroup',
'fkOwn' => 'discount_id', 'fkOther' => 'group_id',
);

References

join

$propDefs['product_id'] = array(
'name' => 'product_id', 'type' => 'join',
'label' => KText::_('Product'),
'modelClass' => 'ConfigboxModelProducts', 'modelMethod' => 'getRecords',
'propNameKey' => 'id', 'propNameDisplay' => 'title',
'defaultlabel' => KText::_('Select Product'),
);

pseudojoin

$propDefs['template'] = array(
'name' => 'template', 'type' => 'pseudojoin',
'modelClass' => 'ConfigboxModelTemplates', 'modelMethod' => 'getProductTemplates',
'propNameKey' => 'value', 'propNameDisplay' => 'title',
);

calculation

$propDefs['calcmodel'] = array(
'name' => 'calcmodel', 'type' => 'calculation',
'label' => KText::_('Price Calculation'),
'defaultlabel' => KText::_('No Calculation'),
'groupby' => 'product_id', 'showLinks' => true,
);

countryselect / stateselect / countyselect

$propDefs['billing_country_id'] = array(
'name' => 'billing_country_id', 'type' => 'countryselect',
'label' => KText::_('Country'),
'stateFieldName' => 'billing_state_id',
'nullable' => true, 'dataType' => 'int unsigned',
);

stateselect points back with countryFieldName, countyselect with stateFieldName — the article shows the full trio.

childentries

$propDefs['answers'] = array(
'name' => 'answers', 'type' => 'childentries',
'label' => KText::_('Answers'),
'viewClass' => 'ConfigboxViewAdminanswers',
'viewFilters' => array(array('filterName' => 'answers.question_id', 'filterValueKey' => 'id')),
'foreignKeyField' => 'question_id', 'parentKeyField' => 'id',
);

Text with a life of its own

translatable

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

rule

$propDefs['visibility_rule'] = array(
'name' => 'visibility_rule', 'type' => 'rule',
'label' => KText::_('Visibility'),
'textWhenNoRule' => KText::_('Always shown'),
);

Prices

groupPrice

$propDefs['price_group_override'] = array(
'name' => 'price_group_override', 'type' => 'groupPrice',
'overridePropertyName' => 'price',
);

calculationOverride

$propDefs['calcmodel_overrides'] = array(
'name' => 'calcmodel_overrides', 'type' => 'calculationOverride',
'overridePropertyName' => 'calcmodel',
);

taxclassrates

$propDefs['taxrates'] = array(
'name' => 'taxrates', 'type' => 'taxclassrates',
'taxclasstype' => 'country',
);

Files

image

$propDefs['image'] = array(
'name' => 'image', 'type' => 'image',
'label' => KText::_('Product Image'),
'allowedExtensions' => array('jpg', 'jpeg', 'png'),
'allowedMimeTypes' => array('image/jpeg', 'image/png'),
'maxFileSizeKb' => '2000', 'appendSerial' => 1,
'dirBase' => KenedoPlatform::p()->getDirDataStore().'/public/product_images',
'urlBase' => KenedoPlatform::p()->getUrlDataStore().'/public/product_images',
);

file

$propDefs['datasheet'] = array(
'name' => 'datasheet', 'type' => 'file',
'label' => KText::_('Datasheet'),
'allowedExtensions' => array('pdf'), 'allowedMimeTypes' => array('application/pdf'),
'maxFileSizeKb' => '5000',
'dirBase' => KenedoPlatform::p()->getDirDataStore().'/public/datasheets',
'urlBase' => KenedoPlatform::p()->getUrlDataStore().'/public/datasheets',
);

Layout — no column, no record key

groupstart / groupend

$propDefs['section_pricing'] = array(
'name' => 'section_pricing', 'type' => 'groupstart',
'title' => KText::_('Pricing'),
'toggle' => true, 'defaultState' => 'opened',
'positionForm' => 10000,
);
$propDefs['section_pricing_end'] = array(
'name' => 'section_pricing_end', 'type' => 'groupend', 'positionForm' => 19999,
);

note

$propDefs['pricing_note'] = array(
'name' => 'pricing_note', 'type' => 'note',
'label' => KText::_('How prices combine'),
'default' => KText::_('Overrides win over the base calculation.'),
'positionForm' => 10100,
);

Identity and ordering

id

$propDefs['id'] = array(
'name' => 'id', 'type' => 'id',
'label' => KText::_('ID'),
'default' => 0, 'positionList' => 10,
);

ordering

$propDefs['ordering'] = array(
'name' => 'ordering', 'type' => 'ordering',
'label' => KText::_('Ordering'),
'group' => 'question_id',
);

Integrations

shapediver*

$propDefs['shapediver_model_data'] = array(
'name' => 'shapediver_model_data', 'type' => 'shapedivermodel',
'label' => KText::_('ShapeDiver Model'),
'dataType' => 'text',
'appliesWhen' => array('visualization_type' => 'shapediver'),
);

shapediverparameter, shapediverparametervalue and shapedivergeometry are declared the same way — shared settings only; the article covers how the four narrow each other.

paymentmethodparams

$propDefs['params'] = array(
'name' => 'params', 'type' => 'paymentmethodparams',
'label' => KText::_('Connector Settings'),
'dataType' => 'text',
);