Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

8542 Posts in 2227 Topics by 1201 members

General Questions

SilverStripe Forums » General Questions » Latest News

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

Page: 1
Go to End
Author Topic: Latest News 294 Views
  • corkg
    avatar
    Community Member
    24 posts

    Latest News Link to this post

    Why does the tutorial for how to get latest news on the homepage not work?

    function LatestNews($num=5) {
    $news = DataObject::get_one("ArticleHolder");
    return ($news) ? DataObject::get("ArticlePage", "ParentID = '$news->ID'", "Date DESC", "", $num) : false;
    }

  • Double-A-Ron
    avatar
    Community Member
    473 posts

    Re: Latest News Link to this post

    It would help if you told everyone what it is doing wrong or even better, what error is being displayed.

    Cheers
    Aaron

  • GeorgeCrawford
    avatar
    Community Member
    8 posts

    Re: Latest News Link to this post

    Hi all,

    I am having problems with the latest new tut.

    I have gone through the tut, but when I go to the homepage of the site get an error about the SQL query....

    [User Error] Couldn't run query: SELECT `SiteTree_Live`.*, `Page_Live`.*, `SiteTree_Live`.ID, if(`SiteTree_Live`.ClassName,`SiteTree_Live`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree_Live` LEFT JOIN `Page_Live` ON `Page_Live`.ID = `SiteTree_Live`.ID WHERE (ParentID = 18) AND (`SiteTree_Live`.ClassName IN ('ArticlePage')) ORDER BY Date DESC LIMIT 5 Unknown column 'Date' in 'order clause'

    Any ideas would be gratefully received!

  • GeorgeCrawford
    avatar
    Community Member
    8 posts

    Re: Latest News Link to this post

    Fixed it!

    It was trying to order by date, which I didn't have in the db.

    294 Views
Page: 1
Go to Top

Currently Online: jseth, J2-Paul

Welcome to our latest member: holy noli

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

Comments on this website? Please give feedback.