Jump to:

23455 Posts in 18904 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » HomePage

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 566 Views
  • anackiy.aleksandr
    Avatar
    Community Member
    3 Posts

    HomePage Link to this post

    Hello! I am a beginner. I hope very much for your help!
    I have TourPage and TourHolder. I want to show on the home page of last 6 pages TourPage. I copied the output function of Tutorial2.

    function LatestNews($num=6) {
    $news = DataObject::get_one("TourHolder");
    return ($news) ? DataObject::get("TourPage", "ParentID = $news->ID", "Date DESC", "", $num) : false;
    }

    I understand there appears dated. How do I change this to select the necessary things to do not by date added, and the ID page in the database?

  • stallain
    Avatar
    Community Member
    61 Posts

    Re: HomePage Link to this post

    Hello, I'm not sure of what you actually need :
    - Do you want another way of sorting the "TourPage" pages appearing on your home page ?
    - Or do you want to be able to manually select the 6 pages appearing on your home page from the CMS ?

    Stan

  • anackiy.aleksandr
    Avatar
    Community Member
    3 Posts

    Re: HomePage Link to this post

    Hello! I want another way to sort "TourPage" pages.

  • stallain
    Avatar
    Community Member
    61 Posts

    Re: HomePage Link to this post

    OK, you just have to replace "Date" by any other field of your page : "ID DESC", "Created DESC", "Title DESC", etc.

    566 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.