LISE API Auto Generate URL from Frontend Form
Posted: Mon Feb 19, 2024 3:08 pm
I'm trying to trigger a GenerateSlug for items submitted from a frontend form.
I have this code in my UDT, but the URL field remains empty:
I'm guessing the field name is wrong, and changed the code to:
And then i do get a value in the URL field, althought it is the string "--error--".
Looking in the class.api.php file it looks like i need 4 parameters ($instance_name, $title, $iid, $cid) and not only the two $title and $instance_name.
Is it possible to generate an URL from a Frontend Form or do i have to make my own custom solution?
I have this code in my UDT, but the URL field remains empty:
Code: Select all
$obj->slug = LISE\api::GenerateSlug($params['title'], 'LISEINSTANCE');
Code: Select all
$obj->url = LISE\api::GenerateSlug($params['title'], 'LISEINSTANCE');
Looking in the class.api.php file it looks like i need 4 parameters ($instance_name, $title, $iid, $cid) and not only the two $title and $instance_name.
Is it possible to generate an URL from a Frontend Form or do i have to make my own custom solution?
Code: Select all
$obj->url = 'myPrefix/' . $params['title'];