0

Is it possible to create a new property on an Entry element for use in a reference tag? I.e.

{entry:[id]:customProperty}

I have tried creating a custom behavior as outlined here, but I believe that creates a new method rather than a property, because it does not seem to work in a reference tag.

class CustomBehavior extends Behavior
{
    public function customProperty(): string
    {
        return 'whatever';
    }
}
...

{entry:[id]:customProperty} //--> Outputs the entry URL rather than 'whatever' (Presumably because it does not recognize 'customProperty')

Is there any way to extend what is available for use in a reference tag without having to create an entirely new element type?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.