I
I
Igor2019-03-30 16:16:58
Drupal
Igor, 2019-03-30 16:16:58

How to change title via theme hook?

In the active theme file MyTheme.theme I wrote

function MyTheme_preprocess_page_title(&$variables) {
$variables['title'] = 'TEST';
}

Why can not work, tell me? It's like the hook just doesn't work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sl0, 2019-03-31
@sl0

So it's not your hook. The hook should be called function MyTheme_preprocess_page(&$variables) otherwise Drupal won't parse it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question