How to programmatically set a default value in Composer ?
Permalink
Here is my problem. I have a page type that is edited with Composer. When a new page is created, I would like to set some attributes with default values that must be calculated - for instance, a date with a default at 60 days from now. The user should be able to leave the attribute blank by removing the default value, so I can't set it when the page is saved.
I tried using an event listener to hook on 'on_page_add', but it seems to be triggered too early or something - the values I set to attributes do not seem to stick.
Is there any way to achieve what I want ?
I tried using an event listener to hook on 'on_page_add', but it seems to be triggered too early or something - the values I set to attributes do not seem to stick.
Is there any way to achieve what I want ?