Skip to main content
added 378 characters in body
Source Link
Luke
  • 531
  • 2
  • 13

yes you can!

You may search for a slug craft.entries.slug('slug-of-first-parent'), select the first result .one(), and then the children by .getChildren(). Now you can proceed as you already did and limit your result to only elements with a level greater than 1 .level('>1') and list.

{% set pages = craft.entries.slug('slug-of-first-parent').one().getChildren().level('>1') %} 

I am not sure whether this is the best and most effective solution, but it should definitely do the job.

Tip: You can display information about an entry and the methods and variables available by dumping them either by using var_dump($variable) in php code or {{ d($variable) }} (by using this free plugin) in your twig template. This can help a lot when dealing with entries and finding children or parents.

yes you can!

You may search for a slug craft.entries.slug('slug-of-first-parent'), select the first result .one(), and then the children by .getChildren(). Now you can proceed as you already did and limit your result to only elements with a level greater than 1 .level('>1') and list.

{% set pages = craft.entries.slug('slug-of-first-parent').one().getChildren().level('>1') %} 

I am not sure whether this is the best and most effective solution, but it should definitely do the job.

yes you can!

You may search for a slug craft.entries.slug('slug-of-first-parent'), select the first result .one(), and then the children by .getChildren(). Now you can proceed as you already did and limit your result to only elements with a level greater than 1 .level('>1') and list.

{% set pages = craft.entries.slug('slug-of-first-parent').one().getChildren().level('>1') %} 

I am not sure whether this is the best and most effective solution, but it should definitely do the job.

Tip: You can display information about an entry and the methods and variables available by dumping them either by using var_dump($variable) in php code or {{ d($variable) }} (by using this free plugin) in your twig template. This can help a lot when dealing with entries and finding children or parents.

Source Link
Luke
  • 531
  • 2
  • 13

yes you can!

You may search for a slug craft.entries.slug('slug-of-first-parent'), select the first result .one(), and then the children by .getChildren(). Now you can proceed as you already did and limit your result to only elements with a level greater than 1 .level('>1') and list.

{% set pages = craft.entries.slug('slug-of-first-parent').one().getChildren().level('>1') %} 

I am not sure whether this is the best and most effective solution, but it should definitely do the job.