Hi all,
I'm looking to have the date automatically added to the field when a new news item is created just in case I have any lazy users who don't bother or forget.
Is this possible/can you give me a clue?
Thanks in advance,
Pnub
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi all,
I'm looking to have the date automatically added to the field when a new news item is created just in case I have any lazy users who don't bother or forget.
Is this possible/can you give me a clue?
Thanks in advance,
Pnub
Hi Pnub,
Does populateDefaults() do what you want?
http://doc.silverstripe.org/doku.php?id=recipes:populatedefaults
Ben
Hi Ben,
Thanks, that does look like what I want. Hope would I implement that? ie: where would i put the code?
Thanks again,
Pnub
Hi Pnub,
Try placing it in your news item class.
Ben
Brilliant, thank you so much.