Jump to content

Selector for nth child of page


gebeer
 Share

Recommended Posts

Hello all,

this is a real beginner's question, I guess.

Got stuck on how to select the nth child of a page.

Couldn't find the right selector at the API cheatsheet or am just to stupid to understand them right. Also searched the forum.

What I want to achieve is something like

$page->child(2nd);

I tried 

$page->child("start=2");

but the script then just stops there without throwing an error.

I'm sure that should be pretty simple but have no clue atm.

Thanks in advance

gerhard

Link to comment
Share on other sites

Greetings,

Gerhard: and now to blow your mind with potentials...

1. Open the cheatsheet (thanks, Soma): http://cheatsheet.processwire.com

2. Look under "$page"

3. Look under "PageArray/WireArray"

4. Consider that you can often chain 2->3 (replace $a variable with your choice in 2)

Use the flexibility wisely!

Thanks,

Matthew

  • Like 2
Link to comment
Share on other sites

  • 6 years later...

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
 Share

×
×
  • Create New...