Support

Account

Home Forums Add-ons Repeater Field Should I avoid using Repeater in this situation ?

Helping

Should I avoid using Repeater in this situation ?

  • Hi,

    I’m building some kind of CRM tool for my event agency, based on wordpress and ACF.
    Each client/event is a custom post in which I have, among other things, a repeater with a few subfields to enter the different payments made to us by the client.

    I would also like to have a page (in the admin) on which I can have an overview of all the payments made by all the clients. With, if possible, the possibility to reorder and filter the payments (by amount or date for example) – and for each payment a link to the post so as i can edit it.

    From what I understood reading these forums, repeaters are overused and can cause different types of problems.

    1) Does the fact my values are in a repeater make this feature less safe (more prone to cause errors) ?

    2) Does it make the queries a lot more complex, impacting performance when filtering for example ?

    3) If yes to any of these 2 questions, is there a better way to handle this ?

    Since I don’t have many subfields in the repeater and I won’t have that many payments in each post I could possibly create the fields in simple groups (with each new line appearing when the previous one is filled), but I don’t know if that would make things any better.

  • I would probably avoid using a repeater if one of your goals is to have an admin page that shows all payments by all users. This is not because the repeater is bad for storing the information you want but it is not suited to aggregating values belonging to multiple posts (clients).

    I would create a separate post type for payments that has a relationship field that connects it to the client. This will give you an admin page that shows all of the payments in one place. You can add filters and actions that will allow you to add columns (for example a client column) and sort and filter content on the page by these columns. There are a lot of tutorials and examples on the web for creating columns adding sorting and filtering to these columns.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.