Repeater Fields for Types and Views

   Amir

December 30, 2011
Update (March 27th 2012): Types and Views 0.9.5 are out, with full support for our implementation of repeater fields. Read all about it in the release announcement.

We’re planning to add repeater fields for both Types and Views and we want to do it right.

Can you add comments here and explain what you’d need repeater fields for and how you will use them in your sites?

If you can also link to existing work that you did that shows it live, it will be great.

 

Comments 44 Responses

  1. I would like to repeat complete blocks with a few fields in it. So not only fields repeating but complete groups

      • Just had to chime in here 😉

        A use-case I have planned is for a recipe type. There are cases where recipes have extra steps that warrant their own block, each with their own fields and custom output. For example, the recipe may have a sauce or other processes that have their own steps.

        Not sure how this relates to the new RC release of T&V. Guess I’ll know soon enough 😉

        Cheers,
        Chris

        • Great example. A ‘step’ should be a child of a ‘recipe’. Then, you can edit the steps right from within their recipe parent. You can display the recipe and all its steps using a View.

          • Yeah, that’s how I’m going to tackle it 🙂 Sooo excited about all the possibilities the new release brings! #happydance

  2. You are already familiar with our Types test project. Jeroen allready told me that you are going to add Repeater Fields so I am waiting for that before I am going to add the Custom Post for Rainbow Bridge. Thats a CPT with dogs that are passed away. The current version of this page type is right here:
    http://oes.nl/pages/voordeoes/rainbowbridge/2009/index.php

    As you can see they are repeating blocks with a title a body and a picture. But without a link. I could do it with custom post types and custom taxonomies but the blocks dont need their own page. So for me it would be much easier if I can make 3 fields in a group and repeat the whole group.

  3. Like @Elles, I would love to be able to use Types and Views to create similar to the page linked to below. We have currently just added all of the content using the HTML editor for the page, but would prefer to use Types and Views to reproduce the same layout.

    http://www.scottcharters.com/stock-service/mens-cashmere/

    Repeating blocks of information which include picture, title, description, size, code, colourways (text) and colourways (nextGen gallery shortcode)

    • Why don’t you use custom posts for this repeating information and make them children of the cashmere page? What’s the advantage in having this information in multiple custom fields in the same post, rather than individual posts each having information about one set?

  4. +1 on the repeater of whole field groups.

    Currently I’m building a site that has a product CPT with listed benefits. Each Benefit has defined fields for benefit title, benefit image and a multiline field for text.

    Right now I had to add 8 such field groups to accommodate a varying number of benefits per product but it would be great to have just one field group defined and have the whole group repeat.

    Pretty much the same thing that Elles describes.

    The other use case would be an repeatable CPT reference field.

    I want to be able do define a repeatable reference field so I can reference any number of posts from a custom post type and connect it this way with a post/CPT entry.

    It would be great to have search functionality similar to the one like adding links to posts or pages inside the editor.

  5. Restaurant menus
    Gig Guides
    Testimonials

    There are plugins that do all of these, but Views would add customisation possibilities – and reduce reliance on additional plugins.

    I agree with previous comments that repeating field groups rather than just single fields would be preferable.

    Looking good so far.

  6. There is 2 use cases that I can think off right now:

    1) Link document to a post / page / CPT. Core media attachments are too limited. This would add a great deal of flexibility. By the way I know there is plugin that can offer such options, but it’s sometimes better for customization ,performances and maintenance to rely only on one plugin.

    2) Set up a quick and easy gallery attached to a post / page / CPT. I think in some cases it is easier for the end-user (administrator / editor) to have the gallery directly build in the content it’s related to. Sometimes it’s better to use external gallery plugin (if you need to reuse you gallery on multiple pages) but sometimes it’s an overkill.

    This is a great enhancement anyway 😉

  7. The way I’m using repeater fields in ACF is creating mini-galleries under certain post types or pages. It’s easier for users to pick and choose photos in nice interface just under post content and not have go to media uploader and gallery section.

  8. Hi there,

    sounds very interesting. I am currently working for an online sports magazine (Polo+10), helping the authors and editors to make their work easier.

    Maybe Repeater Fields will be the right thing for some elemental pieces of data:

    – competition Results Tables – simple groups of data (Team A, Team B, Points A : Points B)

    There are lots of other (table-like) chunks of data, line-ups, team-specific data, list of competitions in year 2012 (Title, Country, …)

  9. I agree here with everyone else with the repeating blocks/groups. One such thing I envision here is galleries or portfolio/project pages. Say for example you have a fairly large project such as Views and Types. You would want to have the body of the page with all your text and inline images but then you want a gallery of screen caps also on the page. Yes you could just attach them to the post and use the gallery function but then you would also get all your inline images. And having the whole block repeating would be best as then you can you whole descriptions and custom things like that much easier.

  10. I agree with all the above. Funny, but I guess in many cases that kind of complex field would be used for creating simple things (like small galleries, testimonials, file attachments etc.). But there’s just great potential in it.

    Good question was: why not use custom post types to achieve that? I would say it’s too powerful for that – it’s power is not needed here.

    Another think: having repeating fields (sections/blocks) would allow us to use “post like” or “post light” (sorry for that) functionality in pages. Doing that we could make site administration as simple as possible and easy to understand, especially for non-technical users.

    • I support this example, ACF has a great implementation of the repeater fields. The only downfall is that it’s not compatible with WPML.
      My usage is mostly for creating table-formatted content. Each repeater field contains sub-fields as columns of the row and by adding new repeater field you basically can build any table of information row by row.

  11. I just got another idea about very useful field type: muliple choice field. Not very difficult to prepare, but it could be a very handy UI element.

  12. Repeater fields would be handy for many purposes, I’m thinking of adding multiple images to a post or page. I am aware of the attachment post type and the possibility of attaching multiple images to a post – but this implementation is easy to break as images appearing within the post html are attachments as well. If I want to display attached images in a sidebar, I will end up showing images contained in the html as well. So this would be a perfect case for a repeater field to give the user the possibility to add as many images he wants (without messing around with NGG galleries or similar).
    I did a bikepark website last year and I had to create a custom post type for obstacles and tracks. Adding technical data like height, length, speed etc. is possible with the simple key:value custom post data wp offers, but having a repeater field here would make it even more comfortable and intuitive for the backend user.

    What I desperately miss on Types at the moment is the Post Object field. A field that offers to choose a post or page (e.g. any post object, also custom post types) that I can restrict to certain post types. E.g. let the backend user choose a single page or single post, or a product if there is a product post type. At the moment I have to do it via a numeric field and IDs, not quite what the backend user would expect (“where do I find this bloody ID?!”).

    I am a bit disappointed there is no way to post or read your support forum without subscription. You are still in beta and therefore you should be thankful for every input and keep the forum open. At least split the forum into subscription-closed and non-subscription-open. My concern: my questions and inputs are about the Types plugin. I love it because it works really well with WPML, but I miss a few features that the “Advanced Custom Fields” plugin offers. Anyway, I am not really interested in the Views plugin, I rather have a nice Types API and code that into my template. So, if I want to post a question about the Types plugin, why do I have to buy a subscription for Views in order to post that question to your forum?

    Don’t get me wrong, I like and appreciate your work a lot. Lovely coding and always up-to-date. I guess you would make a lot of people happy (including me) if you would change a few things.

    Cheers
    Michael

    • We’re going to have something for repeater fields and post reference in a nearby release. This is going to be a pretty powerful combination and I’ll write much more about it.

      Unlike other WordPress plugins, we employ developers who work on these plugins full-time. Currently, there are 3 developers on Types and Views and we’re hiring more. You must realize that this costs money and we’re trying to earn it back. By charging a small fee, we allow to maintain all this work. We handle each and every thread in the support forum. This work requires yet additional resources. So, when we ask for payment, this payment goes towards the code that you use.

      Along with Views, we’re also maintaining a complete API for Types. You can see here how to insert custom fields into your PHP:
      https://toolset.com/documentation/functions/

  13. I think would apply well. I have a site where I created a custom post type where a user could add multiple custom fields for an FAQ page. That seems to be an awesome application of repeater fields

    For the faqs each, the user enters a title for the question and then content for the answer
    http://interim1.digisavvy.com/client-faq

    I also did this for a Team Members Page, too, for the same site.

    • Right. This is a classic example. I think that you’ll be very happy with what we have planned for child posts and repeater fields.

  14. Hi – just wanted to add to the discussion of repeater fields

    (my original post is here: https://toolset.com/forums/topic/fetching-acf-relation-fields-array/)

    One classic (and I believe frequent) use case is that you want to link to “related” items of the same (or a different) custom post type. There are many examples out there, from “related projects”, “similar listings (real estate or whatever)”, “complimentary products” ( like accessories etc.)…

    The “relation” implementation that the “Advanced Custom Fields” (ACF) plugin has is actually great. The UI is also simple, and should have a little AJAX search to find/select items, so it can handle longer lists.

    To me, that would be at the very top of the wish list for Types+Views. Would be great to have 1 plugin-set that covers it all, without having to resort to others.

    What is the plan for a next release? How big would the effort be to implement “relations”?

  15. I’m building a site for a client. The client provides outdoor skills courses (such as mountain climbing, scrambling, navigation etc.) I’ve created a Custom Post Type called courses, and a repeating field would be perfect for listing the dates each course runs.

    • We just released Views 0.9.4 and we’re working on this right now. The support in Types should be ready in about 2 weeks and Views will follow a week after.

  16. When making an interview for an article about a person (aside from the article), repeater fields would come in handy, for custom questions. I’m currently struggling with this. Had to make my own custom metabox outside the plugin. Having the feature in Types would save me so much time.

    Looking forward to it!

    • It’s currently implemented and available in the Types and Views 0.9.5 beta versions. However, it’s in QA now and we’re still fixing things, so please don’t use this on production sites.

      • Hi,
        I am using the repeater field from Advanced Custom Fields plugin to create small image sliders and lists of events, but unfortunately the ACF plugin does not seem to work with WPML. I am really looking forward the Repeater field for the new Types release as it’s what’s I’m waiting for to ensure the complete transfer of my site from qTranslate/ACF to WPML/Types.
        Is there a way to get the Types beta version to test it on my local server? Thanks!

        • We’re in near the end of a long QA cycle for both Types and Views. This will conclude a long development and then we’ll be ready with new versions for all of it.

          Types and Views 0.9.5 will include our solution for repeating fields (we have a different implementation and name for it). It’s also working great with WPML. I suggest waiting a few more days to get the fully tested and cleaned versions.

  17. So Excited for the 0.9.5 release! I’ll instantly be able to get rid of 6 or so plugins, awesome. Can you recommend a WP search plugin that works well with types / views / WPML?

    Also, can I use Gravity Forms to handle front end post submissions, using the repeatable fields create by types?

    • We’re also very excited about this upcoming release!

      For our sites, we use Relevanssi. It works fine with Types, Views and WPML. Once we’re out with this release, we’ll work with the Gravity Forms folks to add support for front-page submission. I think that we should first finalize this release and then we’ll be able to ask them to add features for it.

      • I’ll give Relevanssi a try! I had considered using Apache Solr, mainly for the faceted search ability, but a more integrated plugin like Relevanssi sounds less taxing, cheers for the suggestion!

        I’m glad you’ll approach Gravity about your plugin. Its hugely popular. Do you plan to work with any other plugin dev’s?

  18. This seems perfect for adding names of offspring which number may vary between each horse to a Breeding Horse post type i’m setting up. Would that make sense or am I missing some other solution that’s staring me in the face?

    Multiple values (array?) for each key of a field would be awesome as well, for instance to have the name of the other parent of the offspring along. I don’t have much experience or insight into the programming or how this would be done traditionally but it would solve my particular problem brilliantly.

    I haven’t tried the beta, should I familiarize myself with it or would I find myself update-ing to the final soon enough?

    Thanks for your products, i’m a fan!

    • Version 0.9.5, with all this functionality is pretty close. We’re working our ways through a few final glitches and we’ll be ready in a few days.

      I’ll write a new blog post when we have a good beta to use.

  19. I did not read through all the comments—so this may be duplicate request, but I was going to request the following capability:

    Custom Post Type – Case Study
    *Title
    *Images
    *Content

    Custom Post Type – Client
    *Name
    *Logo
    *Link to Case Study (URL field that you add a link to existing content similar to the WP interface for doing similar)