EXTENSION - Multi-context custom fields

Multi-context custom fields

Hello super joomlers!

I know, I know. Multi what? What is that entangled weird title? Fear not! Delicious meal is coming. Everything going be crystal clear soon. Bear with me. Since Joomla! 3.7 custom fields was merged into Joomla! core. Custom fields was originally a work from Allon Moritz (@laoneo). He decided to gave it to Joomla! community. Big thanks to him and all the Joomla! team and contributors. What you need to know is that core components like com_content (articles) support custom fields out-of-the-box. But how about third-party extensions that we as developers want to make? We want custom fields too for our extensions even more.

This example component com_example showcase how to integrate basic custom fields support and more advanced stuff like multi-context support (think of this like multiple elements that can have theirs own custom fields and groups of custom fields). Eg: A hotel that wants to manage their customers activities during the 4 seasons of the year.

"context 1" : Spring
  Custom field group: "Spring activities"

  • Custom field: Swimming

"context 2" : Summer

Custom field group: "Summer activities"

  • Custom field: Volley Ball


With multi-context custom fields, each seach is listed in a dropdown list in the custom fields filter and in custom fields group filter in Joomla! backend.

Alexandre ELISÉ

Développeur #PHP spécialiste #Joomla! Si mon travail vous a plu n'hésitez pas à laisser votre avis sur Google Reviews. Si mes articles vous ont été utiles vous pouvez me le dire avec Paypal.me ça m'encourage à continuer et me permet de savoir que vous apprecier le contenu. Sinon vous pouvez toujours m'envoyer un email pour me faire part de vos suggestions.

Get the newsletter

Super Joomlers! Get the most out of Joomla!
We hate spam as much as you do and we will not send you email without your prior consent. You can unsubscribe / resubscribe any time you want.