0

There is a team page of the company and there are few links to social accounts which every user have, including the link to their blog posts. This link redirects you to blog page, but only with this user blog articles. The address shows blog/user_id and the title of the page is "Blog". I want the title to be different depending on what user's blog you've entered. Something like this: "John Doe's blog posts". Should I edit blog template? I use Drupal 8.

1 Answer 1

0

Tryout this one Reference

class CustomController extends ControllerBase implements ContainerInjectionInterface
  public function getBlockContent() {
    if ($route = $request->attributes->get(\Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_OBJECT)) {
      $route->setDefault('_title', $some_title);
    }
  }

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.