Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Creating new Site Reports

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1331 Views
  • cerelac
    Avatar
    Community Member
    34 Posts

    Creating new Site Reports Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: Creating new Site Reports Link to this post

    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");
       }

  • cerelac
    Avatar
    Community Member
    34 Posts

    Re: Creating new Site Reports Link to this post

    Thanks willr.

    1331 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.