Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

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.

General Questions /

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

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

HELP I'm seriously Object Confused!!


Go to End


3 Posts   1152 Views

Avatar
tazzydemon

Community Member, 135 Posts

23 August 2013 at 4:54pm

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!!!

Avatar
copernican

Community Member, 189 Posts

27 August 2013 at 12:31am

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

Avatar
tazzydemon

Community Member, 135 Posts

27 August 2013 at 4:08pm

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.