How can I change the labels in the left menu of my Sonata Admin installation?
I would like to change (and understand how they are generated):
These labels are defined in the tags
property in the service definition of your admin page, in the config file of the admin section. See documentation here.
Example in a admin-services.yml
file:
services:
app.admin.category:
class: AppBundle\Admin\CategoryAdmin
tags:
- { name: sonata.admin, manager_type: orm, group: "My Admin Group", label: "Post Categories" }
arguments:
- ~
- AppBundle\Entity\Category
- ~
calls:
- [ setTranslationDomain, [AppBundle]]
The group
tag corresponds to your admin
label, and the label
one to your PostCategory
.
I guess you didn't specify these tags, and admin
is the default group name, and PostCategory
the name of your class.
EDIT:
The label
and the group
option are translation keys. You specify the translation domain under the calls
tag, with setTranslationDomain
, and the default catalog is messages
. See documentation on translation here.