Presented at JoomlaDay Chicago 2019
Of all the features introduced throughout Joomla 3, subforms is the one I rely on most. Subforms are a field type like text, dropdowns, and date pickers. Subforms solve important content issues and significantly improve usability in managing content and settings.
In this presentation I will provide an introduction to subforms, what they can do, and the flex points where we can customize them within our own projects and extensions. Then I will demo and discuss the various ways I have deployed subforms across projects. I’ve come across interesting client needs, and I will illustrate some creative solutions using subforms.
For those of you who are a developer, I will show you how I incorporate subforms into my custom extensions. If you are not a developer, you will be exposed to the potential of subforms and be able to contact me or another custom developer to solve that challenging content problem.
Large Language Models for Test Case Evolution and Repair
The Joy of Subforms with Randy Carey
1. The Joy of Subforms!
• what they are
• the problems they solve
• how you can use them
Randy Carey
Careytech Studios, LLC
Careytech.com
2. Remarkable Features in 3.x
● [3.0] Bootstrap
● [3.1] tags
● [3.2] content versioning
● [3.2] two factor authentication
● [3.3] microdata
● [3.4] frontend module editing
● [3.5] php 7
● [3.6] subforms
● [3.7] custom fields
● [3.7] backend menu manager
● [3.8] new routing system
● [3.9] privacy system
● [3.9] action logging
Of all the major features
of 3.x, the one that I use
the most is subforms.
I build a lot of custom
extensions for clients, and
subforms solves a lot of
challenges.
4. What ARE subforms
• A field type (like text, dropdown, date picker, media, etc.)
• A collection of 0-to-multiple records
• the record is a collection of fields of varying types
• almost 100% customizable
9. Interchangable Form Layouts
Here are examples of the three
layouts Joomla provides.
But we can design our own – which is
very helpful for custom data needs
10. problems solved with subforms
Clients often have challenging
needs. Often, subforms play an
important part of the solution.
11. Problems solved: no limit on items
1
2
3
The Articles form has a fixed number of
fields for links. That was before we had
subforms. With Subforms, we could let
users create as many links as they’d
like.
12. Problems solved: easy re-ordering
Also, the user would be able to
drag-and-drop re-order their links.
Reordering the old way required a
lot more work.
13. Problems solved: different orderings
In this scenario, the order of these managers vary upon each product page.
- With the component’s order field, we can not satisfy this requirement.
- With subforms, we can order each without relying on the component’s order.
16. Problems solved: reusable fieldsets
If a set of fields are commonly used
together, we can quickly reuse that set
of fields by referencing the same XML
file.
In this example, the fieldset is for a
background image with text.
17. Problems solved: extensible
– embracing change!
– custom fields
We must “embrace change” –
because new requirements often
emerge.
Adding a field is as simple as
adding a field declaration to the
XML file. In contrast, adding a
new field to a component
requires changes to the db and
multiple parts of the MVC.
Here is a suggestion:
If a third-party component
provides an empty subform field,
any user can safely add extra
fields to that component by
adding them to the subform’s
XML file.
18. Problems solved: custom form
Here is an example in which I built the edit form
for a client who has special pricing charts.
This custom layout logically mimics the client’s
mental model of his data.
19. Values of subforms
• custom set of fields
• multiple records
• sortable records
• variable # of records
• multiple orderings
• many-to-many
• extensible – custom fields
• tailored/custom forms
24. Where / How you can use them
Component
• As a custom field with a plugin for subforms
• https://www.richeyweb.com/software/joomla/plugins/147-fields-subform
• eShop : as an extra field (other extensions may offer this)
• Create a new menu item type for component, add a subform as a
parameter.
• Component-Creator: create your own component that you can edit
• Outsource – find a skilled Joomla developer
25. Where / How you can use them
Modules & Plugins
• Create your own
• Clone an existing one, modify the XML file (to include a subform)
• Outsource
26. Examples: problems solved with subforms
In this part of the presentation I demoed some
examples from real projects .
27. Examples:
problems solved with subforms
Each alternating block is a record within the
subform.
• Each block has its own settings using a
common fieldset (image, background color,
text, etc.)
• User can create as many as he/she likes.
• User can drag-n-drop order blocks.
28. Examples:
problems solved with subforms
A vendor of biological supplies wanted an
online catalog with the ability to customize a
grid of prices (per piece, per class size, per
volume, whatever based upon the item). The
grid needs to accommodate a variable
number of rows and columns.
Each pricing grid on an item is a subform.
29. Examples:
problems solved with subforms
Many diverse examples could be shown –
both, as to how they help a user manage
content, and as to how they are displayed on
the frontend.
30. The Joy of Subforms!
• what they are
• the problems they solve
• how you can use them
Randy Carey
Careytech Studios, LLC
Careytech.com