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
[5.0] Improve DX on the com_templates(styles) #41388
Conversation
Yay - adding another option - always a popular decision. What is the real world use case for adding this option |
Where did you see that
Obviously I have a use case thus the PR... |
As far as I can see, adding the new option happens only in the testing instructions and is only for testing. |
@SharkyKZ what's your problem and you keep downvoting my PRs? Is there something wrong code wise that you want point out or...? |
Maybe I misread the option part. I still think this needs to be justified with a real world use case. There is only one I am aware of and that was handled by the ext dev with documentation without any issue |
Yootheme are definitely overriding the menu assignment (at least they did last time I used one of their templates). Probably also JoomShaper and many other template studio out there. This is NOT an edge case... |
You still dont explain why they are doing it. And presumably if they are then they have no problem that this pr is solving. /me confused |
@brianteeman there's a |
I read the why - it doesnt really explain the usecase |
Ok, let me try again. So the route joomla-cms/templates/cassiopeia/templateDetails.xml Lines 48 to 166 in 7957282
The only part that IS NOT driven by the XML and it is hardcoded is the menu assignment tab: joomla-cms/administrator/components/com_templates/tmpl/style/edit.php Lines 101 to 110 in 7957282
For a developer to roll their own UI/UX/Logic for the menu selection of a template style there is a requirement to write a plugin that will override the entirety of the layout just to have a rendering of the This PR just enables the |
Basically I'm open for this change, but the way is too limited, normally we would render the complete fieldset and not a single field in a tab, like in joomla.edit.params or joomla.edit.fieldset so making this more generic would make more sense too me. |
@HLeithner code (testing instructions) updated so now the XML could have a new |
Besides all I have a question regarding the title of this PR: What does “DX” stand for? |
Developer eXperience |
I tested this and see the Menu Assignment panel replaced with It works Yes/No panel. But I am left wondering how I would select a menu item for this particular template style. It seems I have to write code to render and process whatever form fields I use instead of the Menu Assignment stuff. And perhaps I might add another panel to keep the Menu Assignment and do something else as well. I don't really have enough experience to say any more. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41388. |
This pull request has been automatically rebased to 5.1-dev. |
I have tested this item ✅ successfully on 9f231fd This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41388. |
I have tested this item ✅ successfully on 5fd67e9 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41388. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41388. |
@dgrammatiko Please fix conflict. Thanks. |
Done |
@Razzo1987 can I have a decision here if this is gonna be merged for 5.1? Thanks |
@dgrammatiko Not yet, but we will give you an update in the next few days Thank you for your work |
Thank you very much @dgrammatiko ! |
* Create template-details-file Docs for PR joomla/joomla-cms#41388
Pull Request for Issue #NULL .
Summary of Changes
Add a way to have the templateDetails.xml drive the entirety (basically the menu_assignment tab) of the style view.
Why?
So, right now the style edit layout has a hardcoded sub layout for the users to select the menus that the template style should be applied. If a developer/template author needs to roll their own menu selecting logic/UI/UX they have to create a plugin, observe the option/view, etc and override the layout. This is way too painful and limiting. Thus this PR, building on the fundamentals of Joomla (basically form fields) allows a way simpler way for devs to roll their own UI/UX (obviously as this is based on form fields it will require AJAX functionality but then again who's not building AJAX first UI in 2023?)
Testing Instructions
administrator/index.php?option=com_templates&view=styles
Cassiopeia - Default
link (or any other style-template in the list)Menu Assignment
</fields>
(line 221) add:Also create a file
administrator/components/com_templates/src/Field/MenusField.php
with the following contentscontent
administrator/index.php?option=com_templates&view=styles
Cassiopeia - Default
linkMenu Assignment
. Now you should have the same menus as beforeActual result BEFORE applying this Pull Request
Too much code needed for such an easy task and too complicated for template authors
Expected result AFTER applying this Pull Request
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org: Template-details-file #41388 Manual#222
No documentation changes for manual.joomla.org needed
@HLeithner could yo have a look at this one? Thanks