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
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);
}
}
}