-
Notifications
You must be signed in to change notification settings - Fork 18
Update doc #258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update doc #258
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,5 +1,55 @@ | ||||
# Customizing the page titles | ||||
|
||||
## Defining the application base title | ||||
|
||||
The application’s base title can be configured using the `sylius_admin.base#base_title` Twig hook. Here's an example of how to define it: | ||||
|
||||
<div data-full-width="false"> | ||||
|
||||
<figure><img src=".gitbook/assets/custom_title.png" alt="Example of a Custom Title in Google Chrome"></figure> | ||||
|
||||
</div> | ||||
|
||||
{% tabs %} | ||||
{% tab title="YAML" %} | ||||
{% code title="config/packages/sylius_bootstrap_admin_ui.yaml" lineNumbers="true" %} | ||||
```yaml | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be cool to have php example as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, and maybe a small screeenshot of the browser tab as well to make it extra explicit? |
||||
# ... | ||||
sylius_twig_hooks: | ||||
hooks: | ||||
'sylius_admin.base#base_title': # The base title block | ||||
default: | ||||
configuration: | ||||
title: 'My app' # here is our title override | ||||
``` | ||||
{% endcode %} | ||||
{% endtab %} | ||||
|
||||
{% tab title="PHP" %} | ||||
{% code title="config/packages/sylius_bootstrap_admin_ui.php" lineNumbers="true" %} | ||||
```php | ||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void { | ||||
// ... | ||||
$containerConfigurator->extension('sylius_twig_hooks', [ | ||||
'hooks' => [ | ||||
// The base title block | ||||
'sylius_admin.base#base_title' => [ | ||||
'default' => [ | ||||
'configuration' => [ | ||||
'title' => 'My app' // here is our title override | ||||
], | ||||
], | ||||
], | ||||
], | ||||
]); | ||||
}; | ||||
``` | ||||
{% endcode %} | ||||
{% endtab %} | ||||
{% endtabs %} | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
## Changing the default title for a specific page | ||||
|
||||
<div data-full-width="false"> | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.