(Newbie) - Looping through a specific query in a template

Hi,

I am able to access and view the HomePage.ss template from the HomePage.php controller show() action (Screenshot 1 below).

However, I can’t loop through the four students and the four jobs (see Screenshot 2 below).

No errors are displayed in both the controller and the template.

Could someone point me in the right direction?

Thanks very much for your suggestions and your help.

K.

Screenshot 1:

screenshot 2:

I think you can do this in HomepageController.php

public function getStudents()
    {       
        $StudentPages = StudentPage::get()->limit(4);
          
        return $StudentPages;
    }

@robbyahn : Thanks. It works.