Custom field of LISE entries in Khronos
Posted: Sun Apr 21, 2024 6:04 pm
Is there a way to have a custom select field of LISE entries in Khronos? I suppose this would be solved with the “dropdown from UDT” but how is this achieved?
Content management as it is meant to be
https://forum.cmsmadesimple.org/
Code: Select all
$mod = \cms_utils::get_module('LISE instance name here'); // put the name of the LISE instance here!!!
if( !is_object($mod) ) {
/* probably handle errors */
return;
}
$item_query = $mod->GetItemQuery($params);
$item_query->AppendTo(LISEQuery::VARTYPE_WHERE, 'A.active = 1');
$result = $item_query->Execute(true);
$items = [''];
while($result && $row = $result->FetchRow()) {
$obj = $mod->LoadItemByIdentifier('item_id', $row['item_id']);
$items[$row['item_id']] = $obj->title;
// $totalcount = $item_query->TotalCount(); // overbodig?
}
if(isset($params['assign']) ) {
$smarty->assign($params['assign'], $items);
}
else {
return $items;
}