Find parent page with specific template from variable depth

is it possible to find a specific parent page with a specific template from variable depth?

something like:

  $parent = $page->parent('dashboard.php');

Untested:

$parent = $page->parents()->findBy("intendedTemplate", "dashboard");
1 Like

indeed - it works! thank you!!!