get('url'); $front_page_node = \Drupal\node\Entity\Node::load(\Drupal::entityTypeManager()->getStorage('node')->getQuery() ->condition('type', 'page') // Change this to the content type if needed ->condition('status', 1) ->sort('created', 'DESC') ->execute() ); // If front page content is found, replace node content with front page content. if ($front_page_node) { $view_builder = \Drupal::entityTypeManager()->getViewBuilder('node'); $rendered_content = $view_builder->view($front_page_node, 'full'); $page['content']['#markup'] = \Drupal::service('renderer')->render($rendered_content); } } } ?>