Currently, EasyAdmin doesn't have a real backend homepage. When you access the backend, you are redirected to the list action of the first configured entity.
I took this decision because 1) I didn't know what to do about the homepage and 2) I didn't have time to do anything.
These are some proposal about having a real homepage:
homepage.html.twig template. If you want to have a real homepage for your backend, override it. If not, leave it empty and you'll see an empty backend home.homepage which let you define the action and the entity to render as the homepage. For example, some people may find that the most important and common task is to create some entity. These people could define the new action of that entity as the homepage to be more productive.What I don't like to add under any circumstance is a dashboard. These are the cool pages with lots of charts, widgets and advanced stuff that you can see in the admin/backend templates. I won't add them because it's extremely complex to do it right and because I believe that a dashboard is completely different from an admin backend.
The homepage could also be a dashboard with statistics.
What about having a dynamic homepage option:
# config.yml
easy_admin:
homepage:
type: controller
resource: "AppBundle:Admin:homepage" # A complete render(controller())
Or this :
# config.yml
easy_admin:
homepage:
type: template
resource: "::admin.html.twig" # a simple "include"
# config.yml
easy_admin:
entities:
'Active Clients':
class: AppBundle\Entity\Customer
'Pending Orders':
class: AppBundle\Entity\Order
'Inventory (2015)':
class: AppBundle\Entity\Product
homepage:
type: entity
resource: 'Active Clients' # or any key from the "entities" array
What do you think ?
Was thinking about some other features for the "Controller" option I mentioned above:
# config.yml
easy_admin:
homepage:
type: controller
resource: "AppBundle:Admin:homepage" # A complete render(controller())
We could add a param option that will have 2 options : render for using render(controller()) in the EasyAdmin template, or override that will completely override the AdminController. This can be done with a simple kernel.request or even kernel.controller listener, depending of what suits the best for this behavior.
This would allow developers to create a controller with multiple actions integrated in his own templates, and best of all, it will rely only on the masterRequest, and will not create a subrequest.
I made a first test commit for this feature, here : 507261c9
Tomorrow I'll add a third parameter, "params", which will allow the user to either choose between "render controller" or "forward controller", which is quite different. By default, "forward" shall be used.
Do you think it to be good ?
@Pierstoval I really appreciate your work, but I'd like to ask you to slow down a bit on this feature. The reason is that I consider this feature one of those that have to be carefully considered. We really need to think about how do people use this backend. And for that to happen ... we need people to actually use this backend. And for that to happen ... we need to create a solid base and focus first on a small set of "must" features.
I'm about to finish one of those features with big impact and I'd like you to help me test it in real backends :)
You can count on my focus as well, I run your backend since your first commit on a small project and so far, so good :)
Same as @nicolaskern for testing, I got a "big" app which is still in development, so I'm glad to test it in real conditions :)
Sorry for being such enthusiastic, I admit I may not realize yet all the big goals of developing such an inovative app :wink:
I created a bundle for making an admin dashboard long ago: https://github.com/kbond/ZenstruckDashboardBundle
It isn't well coded (one of those things I look at now and shake my head) but perhaps some inspiration could be derived from it.
It allows you to configure "widgets" to custom actions for the widgets. I went pretty far with allowing ajax/hinclude widgets.
@kbond thanks for the reference. I haven't looked at the code, but it looks exactly like what a dashboard should be.
However, I still think we can live without a real homepage for some time. In my experience, most people using backends ignore their homepages completely and they just quickly link on the action they want to perform. In fact, I've heard lots of times people complaining about how slow loading is the backend homepage, which they never use or look at.
Yeah, I used that bundle for a few projects but recently I have just been rolling my own dashboards (without the assistance of a bundle). I found they are too custom to be "configured".
@javiereguiluz The people I work with/for are familiar with dashboards, mostly for statistics. This is why I wanted to implement it, especially with a "controller" parameter that allows me to create "dashboard controllers" depending on the different apps.
No problem, we'll wait for this bundle to be more used to think about it, but I hope the issues/PR won't be closed before this time ;)
I'm closing this issue because it's not something that we're going to implement anytime soon.
For now, you can very easily use your own action to render the dashboard, as explained in https://github.com/javiereguiluz/EasyAdminBundle/pull/303/files
And in the near term, we'll implement some logic to customize the main menu and we'll let the developer choose the action/view/entity displayed as the index of the backend.
Use EasyAdminBundle "^1.16"
add to config.yml
homepage:
type: template
resource: "::admin.html.twig"
get
Fatal error: Uncaught exception 'SymfonyComponentConfigDefinitionExceptionInvalidConfigurationException' with message 'Unrecognized option "homepage" under "easy_admin"' in
It's because the proposed feature has never been implemented.
Did you really read the issue?
I think you're right about complex dashboards; however we're working on a very light version: a simple homepage that just displays shortcuts to Entities in a "dashboard like" style:

Configuration:
easy_admin:
dashboard:
title: 'Welcome to shop management'
blocks:
Bloc1:
label: Categories
size: 2
css_class: aqua
class: BackendBundle\Entity\Category
link_label: "Category list"
icon: bars
Bloc2:
label: Products
size: 2
css_class: green
class: BackendBundle\Entity\Product
link_label: "Product list"
icon: barcode
Bloc3:
label: Clients
size: 2
css_class: red
class: BackendBundle\Entity\Client
dql_filter: "entity.is_active = 1'" #allows filtering the count query
link_label: "Client list"
icon: users
i don't think we'll add more functionnalities as it's supposed to be a simple user-friendly home page, not a dashboard.
Please let me know if some of you would be interested in this feature
It's because the proposed feature has never been implemented.
Did you really read the issue?
@Pierstoval actually I'm confused as well.
Unfortunately your PR was closed, but I also see that the homepage configuration key seems to be supported since 2016.
I tried to similarly use the easy_admin.homepage option inside the yaml config but I get the same unrecognized-option/undefined-index error.
Does that work for anybody?
We can't use the homepage attribute manually in our config since it's computed by the DefaultConfigPass.
If you want a custom URL to be used as backend homepage, you have to define a menu entry and set it as default like this:
easy_admin:
design:
menu:
- { icon: home, label: "Admin home", route: my_custom_route, default: true }
# ...
Most helpful comment
I think you're right about complex dashboards; however we're working on a very light version: a simple homepage that just displays shortcuts to Entities in a "dashboard like" style:
Configuration:
i don't think we'll add more functionnalities as it's supposed to be a simple user-friendly home page, not a dashboard.
Please let me know if some of you would be interested in this feature