Fix hiddenLabel and add hiddenLegend form attribute#29710
Fix hiddenLabel and add hiddenLegend form attribute#29710wilsonge merged 3 commits intojoomla:4.0-devfrom Ruud68:fixhiddenlabeladdhiddenlegend
Conversation
|
Not checked this yet but legend has a specific meaning which is not this so it would be better to use some other name |
I am dutch so all sounds good in English :) Legend: "the words written on or next to a picture, map, coin, etc., that explain what it is about or what the symbols on it mean" |
|
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/legend whats wrong with note |
|
But then again, that might be confusing when applying it to a note field where you then set hiddenNote... what are we hiding here, the note or the note field? |
Makes sense to me, "hiddenDescription". @brianteeman What do you think? |
|
So just renamed legend to description. i also set the hiddenLabel to true on the Note field as this field doesn't have a label. |
|
My 2c: introducing |
|
@SharkyKZ using a seperate layout will not change the fact that everything goes through the renderer. What is basically wrong is that the renderer does more then render, it adds things that should be handled by the layout. (the description in this case). So when you remove that from the renderer, then you must refactor all (!) layout files to handle the description: that is a lot of code redundancy. This PR is not about refactoring all fields, it is about building and extending what is already there. changing layouts will most likely also break b/c as implemented layout overrides are then also impacted. |
|
Working on 'fitting' my extensions into the Joomla 4.0 administrator UI. Ran into this issue again where notes used to instruct users (you know, for a better UX) are totally useless and confusing as the notes contents are displayed twice... trying to get some traction for this PR (you know: "hey extension devs, help us because you are the ones using it...") This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/29710. |
|
I think this makes sense and can see from the screenshot above the justification. So merging on review. Thanks! |
|
Thanks for merging! |
* Joomla/4.0-dev: (844 commits) [4.0] Template layout select (joomla#30772) [4.0][CLI] com_finder use console command (joomla#30768) [4.0] Modifying com_actionlogs string (joomla#30758) [4.0] Fancy selectbox fix (joomla#30739) [4.0] Add missing Table Caption (joomla#30763) [4.0] Wrap all buttons in btn-group to improve styling (joomla#30761) [4.0] Cassiopeia missing string (joomla#30765) Improve batch text (joomla#28447) Fix icons not displaying (joomla#30749) Remove the chrome "cardGrey". The same effect can be achieved by using the module class "card-grey" with the "card" chrome (joomla#30734) Remove obsolete html code (joomla#30737) [4.0] Check out improvements related to nullable columns (joomla#30747) Removing card.scss overrides as we don't use those classes Use renderField() method to render fields (joomla#30738) [4.0] spelling (joomla#30742) [4.0] Remove use of ReflectionParameter::getClass() (joomla#30581) [4.0] Fix saving images (joomla#30730) [4.0] Cleanup cassiopeia chromes and rename "default" to "card" (joomla#30729) Fix hiddenLabel and add hiddenLegend form attribute (joomla#29710) [4.0] Fix Debug plugin to display query parameters (joomla#30717) ...


Pull Request for Issue #29611 and #29709 .
Summary of Changes
the PR introduces a new hiddenLegend form attribute that can be set in the xml file as attribute for toggling the legend on any field) or in the layout file to give the attribute an initial value (defaults to true when not set)
Testing Instructions
1.1 add form attribute hiddenLabel="false" to a form field
2.1 add a form field type Note to a config file
2.2 add form attribute hiddenLegend="false" to the 2.1 added field
2.3 add form attribute hiddenLegend="true" to a form field
Expected result
1.1 the label for the form field should NOT ( = false) be hidden
2.1 the legend for the Note field (which is the description that is part of the Note field) should not be displayed
2.2 the legend for the Note field should be DISPLAYED
2.3 the legend for the form field that you added the attribute to should be HIDDEN
Actual result
whithout this PR:
1.1 the label for the form field IS hidden
2.1 the legend IS shown with the same information as the note itself
2.2 the legend IS shown with the same information as the note itself
2.3 the legend IS shown for the form field that you added the attribute to
Documentation Changes Required
yes, same changes as made for the 'hiddenLabel' attribute