original_string: public function inherited($route, $field = null)
      {
          if ($field !== null) {
  
              $page = $this->dispatch($route, true);
  
              $parent = $page ? $page->parent() : null;
              if ($parent && $parent->value('header.' . $field) !== null) {
                  return $parent;
              }
              if ($parent && !$parent->root()) {
                  return $this->inherited($parent->route(), $field);
              }
          }
  
          return null;
      }
code: public function inherited($route, $field = null)
      {
          if ($field !== null) {
  
              $page = $this->dispatch($route, true);
  
              $parent = $page ? $page->parent() : null;
              if ($parent && $parent->value('header.' . $field) !== null) {
                  return $parent;
              }
              if ($parent && !$parent->root()) {
                  return $this->inherited($parent->route(), $field);
              }
          }
  
          return null;
      }
code_tokens: public function inherited ( $ route , $ field = null ) { if ( $ field !== null ) { $ page = $ this -> dispatch ( $ route , true ) ; $ parent = $ page ? $ page -> parent ( ) : null ; if ( $ parent && $ parent -> value ( 'header.' . $ field ) !== null ) { return $ parent ; } if ( $ parent && ! $ parent -> root ( ) ) { return $ this -> inherited ( $ parent -> route ( ) , $ field ) ; } } return null ; }
docstring: Get a page ancestor trait.
  
  @param  string $route The relative route of the page
  @param  string $field The field name of the ancestor to query for
  
  @return PageInterface|null
docstring_tokens: Get a page ancestor trait .