Page 1 of 1

LISE and frontend users

Posted: Tue May 28, 2019 8:21 am
by iturbay
Is it possible to add content to the LISE module from the site, without using the admin panel?

Re: LISE and frontend users

Posted: Tue May 28, 2019 1:34 pm
by DIGI3
Not in the current version, but I've heard that's on the roadmap for the next major release.

Re: LISE and frontend users

Posted: Tue May 28, 2019 3:39 pm
by Jo Morg
iturbay wrote:Is it possible to add content to the LISE module from the site, without using the admin panel?
DIGI3 wrote:Not in the current version, but I've heard that's on the roadmap for the next major release.
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.

Re: LISE and frontend users

Posted: Tue May 28, 2019 4:55 pm
by iturbay
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
it's great!

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?

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);

Re: LISE and frontend users

Posted: Tue May 28, 2019 5:17 pm
by Jo Morg
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?
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.

Re: LISE and frontend users

Posted: Wed May 29, 2019 3:13 am
by iturbay
Everything worked out!

The problem was that in FormBuilder indicated -User Defined Tag Call, and I need to specify -Call A User Defined Tag With the Form Results