Skip to main content

Shared Field Reuse Across Views

Define a field once โ€” and reuse it everywhere with consistency and control.

What Is Field Reuse in JCB?

Joomla Component Builder (JCB) allows you to define fields once and reuse them across multiple views, components, or contexts. This promotes consistency, reduces redundancy, and makes managing complex forms significantly easier.

Instead of redefining similar fields repeatedly (like โ€œstatus,โ€ โ€œpublished,โ€ โ€œcreated by,โ€ or โ€œcustom selectorโ€), you can create a shared field and insert it into any view via JCBโ€™s GUI โ€” and all associated logic, validations, rendering, and templates come along with it.

Key Features

  • โ™ป๏ธ Define Once, Use Everywhere: Create a field (with validation, display rules, and logic) and apply it to multiple admin or site views without duplicating.
  • โš™๏ธ Centralized Management: Changes made to the shared field automatically apply everywhere itโ€™s used โ€” reducing future maintenance.
  • ๐Ÿง  Linked Logic & Layout: Validation rules, get/save hooks, CSS/JS assets, and display overrides follow the field wherever itโ€™s used.
  • ๐Ÿ”„ Round-Trip Safe: Insert/replace tags within the fieldโ€™s custom code ensure that manual edits are preserved during rebuilds.
  • ๐Ÿงฐ Fully GUI-Configurable: No code required โ€” field reuse is managed visually via the Fields manager and View mapping system.
  • ๐Ÿงฉ Supports All Field Types: Whether itโ€™s a dropdown, calendar, checkbox, subform, editor, or custom selector โ€” every JCB field type is reusable.
  • ๐Ÿงฌ Dynamic Assignment: Reused fields can still behave uniquely depending on where theyโ€™re used, based on conditional visibility or layout templates.

Common Use Cases

  • Reuse standard fields like status, language, or ordering across all views
  • Share a โ€œuser selectorโ€ or โ€œauthorโ€ field across components
  • Embed the same subform (e.g. address block) into multiple forms
  • Maintain consistency for multilingual input fields or toggles
  • Reuse custom validators or save logic tied to a specific field

How to Use in JCB

  1. Go to Fields โ†’ Create a new field (or edit an existing one).
  2. Configure all logic, constraints, field type, and rendering behavior.
  3. In any View โ†’ go to the Fields tab โ†’ Select โ€œAdd Existing Fieldโ€.
  4. Choose the shared field from the list.
  5. (Optional) Override display settings or visibility per instance.
  6. On compile, JCB ensures each reused field works as if it was native to the view.

๐Ÿง  Pro Tip: Combine field reuse with field groups or tabs to build modular, repeatable form sections.

Conclusion

Shared field reuse is a core productivity and scalability feature of JCB. By treating fields as reusable building blocks โ€” complete with logic, rules, and styling โ€” you create smarter, faster, and more consistent components across your entire Joomla ecosystem.