Jump to:

22976 Posts in 11493 Topics by 2824 members

General Questions

SilverStripe Forums » General Questions » HELP I'm seriously Object Confused!!

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: 235 Views
  • tazzydemon
    Avatar
    Community Member
    114 Posts

    HELP I'm seriously Object Confused!! Link to this post

    Guys

    After having created a lot of working page types in ss3.1 I now realise that quite a few page types should have the Foundation Orbit slider on them. I therefore cur it out of one working page type and created a new intermediate object OrbitPage.php (which extends Page) and then I extended my pages that need a slider on OrbitPage.

    OrbitPage uses another object, OrbitImage, which uses gridfield sorting and a few other things. In OrbitImage I had the following function derived from http://www.silverstripe.org/general-questions/show/20603

    function getNextSortID() {
    $getDataList = $this->Page()->OrbitImage();

    if (!$getDataList || $getDataList->Count() == 0) {
    return NULL;
    } else {

    return $getDataList->first()->SortID + 1
    }

    SS3 now baulks on the $this->Page() method which worked when this function was called in reference to a page type one object separated from Page.php. Now I have say, HeroPage extending OrbitPage extending Page, I can't find the right site tree method. $this->OrbitPage() does not work

    HELP!!!

  • IOTI
    Avatar
    Community Member
    187 Posts

    Re: HELP I'm seriously Object Confused!! Link to this post

    Shouldn't it just be "$getDataList = $this->OrbitImage();" ?

  • tazzydemon
    Avatar
    Community Member
    114 Posts

    Re: HELP I'm seriously Object Confused!! Link to this post

    Well there was a more sever issue anyway in that the twice removed page types took the intermediate name ...so I abandoned this, but thanks for the tip.

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