Page 1 of 1

Lise add custom field value to url template or alias template

Posted: Wed Apr 19, 2023 4:11 pm
by pierrepercee
Hello,

I know smarty tag references ({Prefix} {ItemTitle} etc...) for generate url template or alias template. I would like to use the value from a particular custom field. It doesn't work with

Code: Select all

{$item->fielddefs.myfield->value}

adding to URL template in options tab

But I can add for example

Code: Select all

{microtime(true)} or {smarty.now}
Is there a way to add the value from a custom field ?

Re: Lise add custom field value to url template or alias template

Posted: Wed Apr 19, 2023 4:24 pm
by Jo Morg
Not an easy feature to implement: as a custom field doesn't have a value until it is filled (whether it has been saved or not), the task has to be done via javascript, browser side, and AJAX, with all the implications it may have. I believe it can be implemented, but I'd have to play with the idea a bit to see if its feasible. I have a huge backlog of work already so that will probably have to wait till LISE 2.0 or so...

Re: Lise add custom field value to url template or alias template

Posted: Wed Apr 19, 2023 4:34 pm
by velden
Wouldn't it be possible to do it using some UDT logic and an event?

Re: Lise add custom field value to url template or alias template

Posted: Wed Apr 19, 2023 4:46 pm
by Jo Morg
@velden, you could eventually be able to pull that one off with some sort of placeholders in the template that could then be replaced in the save event via an UDT. It would probably have to be something along the lines [placehloder1]/[placehloder2].... etc and then on the UDT make the replacements, but yes, something like that would be possible indeed

Re: Lise add custom field value to url template or alias template

Posted: Wed Apr 19, 2023 5:10 pm
by pierrepercee
Thanks Jo Morg,

I had the same idea as Velden. I will wait until Lise 2.0. It's not urgent.