LISE and frontend users
Posted: Tue May 28, 2019 8:21 am
Is it possible to add content to the LISE module from the site, without using the admin panel?
Content management as it is meant to be
https://forum.cmsmadesimple.org/
iturbay wrote:Is it possible to add content to the LISE module from the site, without using the admin panel?
Although DIGI3 is correct in that there will be a module which will easily allow frontend editing to LISE, and which is already being tested, so I hope the release will be ready soon(ish), there is a method via LISE API using either FormBuilder or CGBetterForms to build the frontend forms and process the data via an UDT. I believe there are still articles in the web about the process with FormBuilder and LI2, and the adaptation should be relatively simple for those who can find their way around PHP. Otherwise just wait for the release of the new module, it will be in sync with the new major release of LISE.DIGI3 wrote:Not in the current version, but I've heard that's on the roadmap for the next major release.
it's great!there is a method via LISE API using either FormBuilder or CGBetterForms to build the frontend forms and process the data via an UDT. I believe there are still articles in the web about the process with FormBuilder and LI2
Code: Select all
/**
* Load wanted ListItExtended instance, where you wan't to save items.
* If instance can't be loaded, it will silently return.
*/
$mod = cmsms()->GetModuleInstance('LISEProjects');
if(!is_object($mod))
return;
/**
* Intitate item with identifier 'alias', $params['title'] comes from FormBuilder.
* Do duplication check with 'item_id', silently return, if item already in database.
*/
$alias = munge_string_to_url($params['title'], true);
$obj = $mod->LoadItemByIdentifier('alias', $alias);
if($obj->item_id > 0)
return;
/**
* Fill previously initiated ListIt2Item object with values from form submission.
* NOTICE: All params that are not known by ListIt2Item object are going to ignored.
*/
$obj->title = $params['title'];
$obj->alias = $alias;
foreach($params as $key => $value) {
if(isset($obj->fielddefs[$key]))
$obj->$key = $value;
}
/**
* Save this object to database by using ListItExtended API.
*/
$mod->SaveItem($obj);
The UDT works as is, the error must be in the FormBuilder template. [not specified] or [unspecified] means that FB is assuming the field is empty. So double check your form template, that is where the error seems to be.iturbay wrote:I found on the forum UDT, but it does not work as it should.
A new LIS element is created, but the transmitted field is not displayed. The field displays [not specified].
Could you tell me where the error is?