Advanced Custom Fields

CMTV

Well-known member
Hi!

Firstly, I love xenForo 2.0 and think this is the best forum engine out here. Most of all I like its flexibility and I want to suggest a way to greatly increase it.

__________________________________

Having opportunity to add custom fields is amazing. But in my opinion right now it is not realized as it should be. Of course current custom fields add some flexibility to xenForo but with additions/adjustments listed below it can turn into a really powerful system.

What do I suggest?
  • Add custom fields support to all entities that can be created via <form> in xenForo (users, threads, conversations, posts, status messages and so on) including the ones we create in admin panel (prefixes, trophies, user groups, help pages and so on)
  • There should be an option to not to display property at all in the predefined list of locations. Maybe I want to edit a template and display custom field with my own html code and at specific location. Having in mind amount of supported entites it might be an option to leave only "before content" and "after content" display locations.
  • (Optionally) Disable some core fields of entities
  • Custom PHP validation (handlers) and JS validation/change event catchers for fields.
  • An option to add CSS/ID's to the whole custom field not only on it's value part
  • More custom field types (including colors, icons, images, links). It also would be super great to have some repeatable types (it will be handy if a user want's to provide an array of values of certain type)
  • An ability to write custom html output at predefined location. For now it is displayed as two columns: key (name of custom field) and value. Maybe I want to use predefined location but want to have my own output completely
  • A primitive conditional logic system. For example, display that custom field (textfield) only if another custom/core field (checkbox) of the same entity has value (checked) and so on. It should work in real time on front end.

Why (do I think) it is necessary?

Take a look at one of the most popular WordPress addons: ACF (Advanced Custom Fields) (How it works)

ACF is used to easily extend WordPress content types (posts/tags/categories primarily) with new fields with fancy and handy user interface in order to display that information (meta) on the blog's front end.

Basically, I want to have absolutely the same functionality in xenForo as internal system or payable extension (like Resoure Manager).

It can even use the same structure: a separate admin navigation category about custom fields. You create a custom field and then select an entity (through <select>) to which it will be attached. Then goes custom field type, ID, conditional logic and so on! Programmatically (in common words) I think it could be reasiled via creating an Entity child that supports connection to global custom fields database table. When creating it looks for custom fields added for an entity and adds them into the form. When getting the entity on front end it just gather data from the same table so there is no need to alter every entity's structure table.

Having so would dramatically increase xenForo flexibility allowing to extend it in any way and size and therefore it's popularity.

Every forum holder (even the one who is not familiar with programming) will be able to easily adjust forum for his own needs through UI with no need to create addons. For example, extend prefixes so they know apply image/icon, custom border radius and so on and all of this could be done via three additional custom fields for prefixes.

Those who have some experience in programming will be able to easily turn forum into something else (like e-shop or tickets system) with no need to create addons.

xenForo is already modular (as it fully supports creating custom style properties/custom options/custom forms and so on), has a solid OOP foundation and already support a very basic custom fields system so I don't think it would be hard to further develop this system and bring it to an absolutely new and decent level.

__________________________________

If you want to see advanced custom fields in xenForo please (y) like this post!

Also don't forget to share your opinion here!
 
Last edited:
Top