Trying to replicate SS4 tutorial lessons - issue

Hi,

In SS4 tutorial lessons, the actions LatestArticles() and FeaturedProperties() are defined in the HomePageController. In the matching HomePage.ss template, two loops loop through those actions (screenshot 1).

I tried to replicate this in my work with the actions getStudents() and Jobs() in my controller (screenshot 2).

getStudents() by itself works fine. However, I get an error (screenshot 3) whenever I include the two loops in my template.

I think I am missing some key SS concept, but can’t quite find it in the tutorial and the documentation.

Thanks for your suggestions & help.

K.

Screenshot 1:

screenshot 1

Screenshot 2:

Screenshot 3:

Please include code as text, rather than screenshots.

Also, please include your template. It’s impossible to help you fix your template if you don’t show what your template code is.

It’s also always a good idea to show the stack trace whenever you get an error. The stack trace may point out something that code examples won’t.

Hello Kami,

the error message is not related to your loops. The error message hints to a call of the function Level() without a parameter (Level($level)) gives you the current parent of a page of a certain level.

Kind regards,

Andy