Jump to content

Recommended Posts

Posted

Am trying to list 3 other events (siblings) at the bottom of an event page.

My problem is I can only seem to limit before I remove the $page part meaning I end up with only 2 other events at the bottom of the page.

Have tried the following but doesn't seem to work:

$page->siblings->remove($page);
$events = $page->siblings("limit=3");

I've tried various things but perhaps someone more knowledgeable could point me in the right direction?

Thanks :)

Posted

You could also do this:

$events = $page->siblings->remove($page)->slice(0,3); 

but this may be better:

$events = $page->siblings("id!=$page, limit=3"); 
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...