A drupal newbie here. I'm looking to build an "issues navigator", a custom block displaying a menu. I'd like to set the "current issue" automatically, from the title of the node that is set as the homepage. How do I do that?'

This does not give me what I want.

$site_frontpage = \Drupal::config('views.view.frontpage');

Putting this information into a block will be a separate story.

  • The code might give you at best a node ID or a path alias. Load the node from that ID or the path alias using the entity_type.manager service and then you can simply do $node->getTitle();.
    – leymannx
    Commented Sep 12, 2023 at 17:06


Browse other questions tagged or ask your own question.