Hi everyone.
I've read the tutorial about creating new site reports here and I've created the "All Pages" site report example.
I want to know is if it's possible to create custom site reports like "Pages edited in the last 2 weeks" but, instead of 2 weeks, I would like to have something like "Pages edited in the last 3 weeks" or "Pages edited in the last month".
Best regards.
We've moved the forum!
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.
You can just copy the Pages edited in the last 2 weeks reports code and change the date or something. Assuming you have read the Tutorial and understand how to write your own report class etc your records() method would be
// get latest 3 weeks (21 days) of edits
function records() {
return DataObject::get("SiteTree", "`SiteTree`.LastEdited > NOW() - INTERVAL 21 DAY", "`SiteTree`.`LastEdited` DESC");
}
Thanks willr.