Skip to main content

Repeatable Fields

key to building flexible data-entry structures such as lists, feature sets, nested elements, or configurable groups

What It Means

Joomla Component Builder (JCB) supports powerful repeatable fields through subform templates — enabling you to define groups of fields that can be repeated dynamically by users in both the admin and frontend interfaces. This feature is key to building flexible data-entry structures such as lists, feature sets, nested elements, or configurable groups.

What Are Repeatable Fields?

Repeatable fields let you allow end-users to:

  • Add multiple entries of a defined group of fields (e.g., title + description + image)
  • Maintain order and grouping of those entries
  • Control field visibility, required status, and field types per entry

In JCB, this is implemented using:

  • Joomla's native subform (repeating) field type
  • A reusable subform template entity, defined once and attached as a field type
  • Visual field-to-subform mapping within the JCB GUI

💡 Think of it as creating a "mini-form" and allowing it to be repeated.

Key Features

  • 📁 GUI-Based Subform Templates: Create the structure of your repeatable set in the GUI using standard JCB fields.
  • 🧩 Fully Nestable: Subforms can contain complex field types including editors, selects, uploads, or even conditional fields.
  • 🛠 Full Compiler Support: JCB compiles the repeatable subform structure directly into the XML form definition, respecting Joomla conventions.
  • 🔄 Round-Trip Compatible: Insert/replace tags and custom logic attached to subform fields persist through compiles.
  • 📄 Layout & Display Integration: Control how repeated data is rendered using JCB layouts or templates.
  • 🎛 Frontend or Backend Usage: Repeatable fields work in both the admin (edit view) and frontend (site views or forms).

Use Cases

  • Feature lists (title + icon + text)
  • FAQs or repeating questions
  • Dynamic link/button groups
  • Staff member or testimonial entries
  • Repeating data blocks (contacts, opening hours, etc.)
  • Multi-language content blocks per item

How to Implement in JCB

  1. Create a Subform Field (JCB > Fields > Subform Fieldtypes)
  2. Define the fields within the Subform
  3. Link the field to your Admin View that uses the "subform" field type
  4. Optionally define layout/display logic for how repeated values are rendered

Best Practices

  • Use field naming prefixes inside subform to avoid naming collisions
  • Ensure all subform fields are mapped with correct field types
  • For complex rendering, create a layout or template to output subform entries

Conclusion

Repeatable fields empower your components to offer dynamic, user-driven data structures — without hardcoding multiple fields manually. Through Subform Templates, JCB provides a highly reusable, versionable, and Joomla-native way to implement this flexibility into any component form.