Customizing the page titles
Last updated
Last updated
By default, each page has a default title based on both page location and resource name. If you're not happy with the preset title for a specific page and would like to customize it, you can easily change it using Twig Hooks.
Search for "title_block" in the call graph of the Symfony debug profiler in the Twig Hooks
section.
We're going to reuse this hook and its template in our config file and add a header
key:
Note that you can also use Symfony Expression Language in the configuration key for dynamic titles:
@=_context
contains all the current Twig vars.
To add an icon to the page title, you need to use Twig hooks configuration.
Search for "title_block" in the call graph of the Symfony debug profiler in the Twig Hooks
section. We're going to reuse this hook and its template in our config file.
Here's an example to define a "users" icon on a speaker list.
You can also define a default icon for every "index" pages.
To add a subheader to the page title, you need to use Twig hooks configuration.
See the previous section to see how to search for the title block.
Here's an example to define a subheader on a speaker list.