0

I know how to create a custom form field if I am building a module/component/plugin but how do I build one of the Joomla! custom fields?

I can't find a tutorial and I think I'm probably Googling the wrong thing (disclaimer: other search engines are available... kind of)

2

I think you might be right there aren't direct official tutorials on this. But in the Joomla! documentation there is a hint.

A developer focused pdf from the creator of custom fields Allon Moritz called DPFields at this time and merged into Joomla! 3.7

https://joomla.digital-peak.com/images/blog/JDD16%20Custom%20fields%20in%20Joomla%20for%20developers.pdf

And another link on the official Joomla! documentation: https://docs.joomla.org/J3.x:Adding_custom_fields/Implement_into_your_component

6
  • 1
    Also, if you're wanting to implement custom fields in your own component, then there's a tutorial step at docs.joomla.org/J3.x:Developing_an_MVC_Component/… – Robbie Jackson Sep 19 '20 at 21:57
  • Thanks @alexandreelise are you saying that for com_content I should just be adding it to this area: components/com_content/layouts/field/prepare/foo.php because it is a custom custom field it won't be ovewritten by the core. – Eoin Sep 21 '20 at 9:13
  • 1
    @Eoin it would be better to base your code on actual core custom fields and learn from the core custom. The simplest one is text field in JPATH_ROOT/plugins/fields/text learn from that one first then learn from other fields in the plugins fields group – coderparlerpartager Sep 21 '20 at 15:14
  • 2
    In the final release of version 3.7 the fields got migrated to plugins. – Laoneo Sep 28 '20 at 15:16
  • Thanks @Laoneo so then I would simply duplicate a plugin and stat to write my own from there? Is it just the plugin folder I need to duplicate? It seemed like quite a lot more than that. – Eoin Mar 12 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.