-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[4.0] Fixed titles for 3rd party component dashboards #31382
[4.0] Fixed titles for 3rd party component dashboards #31382
Conversation
I wasn't able to translate the string yet to my liking, I must be missing something somewhere. But code review looks fine. There is no reason to use |
Is your dashboard identifier "myextension" or "com_myextension"? I looked at the code of com_sermonspeaker you uploaded for another PR, where it was only "sermonspeaker". ;-) This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31382. |
I have tested this item ✅ successfully on c117565 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31382. |
I have tested this item ✅ successfully on c117565 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31382. |
All other Components do also not have an icon alongside. So, I don't understand (?) Tks. |
Fix for test script: This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31382. |
Yep, that looks indeed fishy in the code. Since the core dashboards all use just "content" or "users", one should expect 3rd parties can use the same naming convention. But those names all come from the com_cpanel.ini which is architecturally wrong. They should come from com_content.ini or com_users.ini which would also make it work for 3rd parties then. |
I've fixed the titles with #31392. My PR already also incorporates this one for better testing. I'll update mine as soon as this here is merged. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31382. |
Thanks! |
Summary of Changes
In version 4, extensions can create their own dashboards. While this is a really cool feature, it seems to be mostly undocumented, so I had to do a bit of research on how to use this, by reading PRs like #28027, #27773 and similar.
The code for
com_cpanel
contains parts to define the title and icon used for the dashboard. However, these don't seem to work. There is a test that checks if the$extension
string starts withcom_
. But previous filtering convertscom_something
intocom-something
.Testing Instructions
If you develop your own extension, this is the perfect occasion to test dashboards. ;-)
Actual result BEFORE applying this Pull Request
There is no icon and the title says "Home Dashboard".
Expected result AFTER applying this Pull Request
An icon is shown and the title says "DemoJ4 Dashboard" (or what you have specified as
COM_<YOUR COMPONENT>_DASHBOARD_TITLE
.Documentation Changes Required
The whole feature lacks documentation. I'm not even sure if it is correct to name the dashboard
com_demoj4
for a component with the namecom_demoj4
or it should be justdemoj4
.Pinging @Bakual as I saw you used the dashboard already for your extension. Of course, it would be great to have other extension developers here as well who might be already using this feature as well.