Request to allow Perch Import Collection API to handle repeaters and blocks

  • Basically exactly what's in this thread:

    http://forum.grabaperch.com/fo…does-not-handle-repeaters


    Our use case is listing authors for scientific research papers - would like to use a repeater field with author first name and last name. I can't use a repeater because most of the content is getting imported from a public database search, and we are using the Import Collection feature of the API to add it to Perch.

  • drewm

    Approved the thread.
  • I would love this too. Not just for the Collection Import API, but for the PerchAPI_ContentImporter in general. I have a custom app with its own import API and it would useful to be able to import into a repeater field.


    In your case, you may want to consider using relationships here. You can import authors into a separate Collection, grab their item IDs and add them into the research paper item.


    PHP
    1. $Importer->add_item([
    2. 'title' => 'Paper title',
    3. 'authors' => [12, 3],
    4. ]);


    This would also allow you to filter the research papers by authors with perch_collection().