Follow up on #8085 - refactor com_contact form to support renderField #8473
While there are a couple of code style changes in files that are not directly related to com_contact, I thought it would be good to include them in this PR since they were edited in the same context.
The method used to check for a required state and / or field of the type label is not very clean but should suffice for now. I normally would have created or rewritten the fields and their layouts but that would have been too much for this PR and, as @wilsonge told me, that is planned for the near future. Take a look at layouts/joomla/form/field/radio.php to see where this is going.
My goal was to unify the output / markup, to fix some bugs and add some functionality to all of the forms of com_contact and com_users (registration / login).
Long story short, how to test?
If you have any questions, suggestions or corrections feel free to contact me.
The text was updated successfully, but these errors were encountered:
The following changes were made to this file, starting from the top: - Removed the error-handle code block at the top that seemed to be left over from Joomla! 1.6 - Added the well CSS class suffix to the form to match the output / markup of com_users.registration and login - Rewritten the foreach loop to fetch the fieldset and field information from the xml file and make use of the renderField method - Adjusted the markup containing the button and hidden field/s to match the output / markup of com_users.registration and login
The following changes were made to this file, starting from the top: - Removed the com_media variable assignment since there seem to be no reference where this was used - Removed unnecessary jimport for jhtml bootstrap
This adds a component specific renderfield JLayout override. The "optional" addition to the label for required fields was moved from the com_contact form layout in here to be able to use the renderField method in the layout file.
Change contact form fieldset label to match the com_users schema and add component specific "* Requied field" "constant"
…com_users Besides reordering the label and description attributes in this file which, to be honest, was more about finding peace and satisfying my OCD, I've changed the fieldset label to match the format that is used in com_users and added a spacer label to output the *Required field hint for the form.
These changes allow a more direct access to input, label and the options
I have tested this item
Otherwise the PR looks very good. Awesome work!
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8473.
Thank you for your comments and tests.
I replaced the StringHelper::strlen method with the nativ strlen function and extended the foreach loop to only render the fieldset when captcha was enabled.
It would mean a lot to me if you could test it again, please.
@brianteeman thank you for your input.
I would like to see the addition of the well class suffix to the form more of a bug fix than a potential b/c issue. If we look at the registration and login view of com_users e.g, both forms have the well suffix. Adding it would add to the general user experience (forms look like "this" ~> POLS).
I've checked approx. 50 sites (google / j.org showcase) where this would have no negative impact.
Templates aren't covered by our B/C policy. So this PR doesn't have to be backward compatible in this regard.