Support

Account

Forum Replies Created

  • Thanks John,

    Although it seems a good idea to change my configuration to a bidirectional relationship, that still doesn’t help with the idea of a recursive query. If I wanted to query a family tree showing a child, their parents, and the parents parents etc, I’d need some kind of recursive query.

    Otherwise, I suppose I’d just have to do multiple queries in a recursive code block.

    Regards
    Pete

  • Why not create a custom post type called control with the number stored in it and remove it from the dashboard. The chances of it being deleted is almost nil.

  • I think I’ve got the same problem outside of guttenberg blocks. I have a relationship field in a repeater but after doing the setup_postdata, I still see the original post details not the related post. I’ll try adding the postid and see if it works.

  • Solved. I forgot all about the default definition which sets the relationship field to object. Changing it back to ID fixes my issue

  • I’ve done this by clicking the new row and adding the fields, but this is doing it as if the user was inputing the values not by programmatically adding a row

  • John, Christian came up with a possibility which I haven’t had chance to test yet, but it looks like it might be a good solution.

    Thanks again for your help

    Pete

  • Thanks again Christian, if I give you my problem, maybe you can finish it all! Lol

    People like you make people like me very happy and you’ve helped me a lot.

    Regards
    Pete

  • Thanks Christian,

    Is the <my key> the repeater field key? This looks like it is trying to add another repeater field, not a row in the repeater, but what do I know.

  • Thanks again John. What really annoys me is the developers have created this fantastic plugin, then gone further and added a javascript library which adds another level of sophistication, but then seem to ignore customers that want to make use of it.

    I’ve worked for 40+ yeas in IT development. support and consulting, and I understand it’s difficult, but we never released a toolset then didn’t give our customers documentation or support for it.

    Anyway, enough a a rant. I have a field group as follows;
    Picture – image
    Location – text
    Date – datepicker
    People – Repeater
    –Person – relationship
    –coord_left – number
    –coordtop – number
    –coordright – number
    –coordbottom – number

    I load the image and run a js using Clarifai’s face recognition engine. It returns boxes around each face in the picture and a list of coords of these boxes.

    I want to populate the repeater field with the ID of a unknown person (from the people field group) and he coords from above. The user will then change the person from the unknown person to one from the field group and save the post.

    I have the recognition working and the trigger click firing the code from the acf.addaction append code you pointed me at. I’m trying now to add the ID and coord fields with the data from the face recognition.

    I was hoping I could have something to loop through the faces I have, triggering the new row, then adding the 5 fields. Although this should work, it’s a bit messy.
    I would have hoped there was a add.row function that I could call to add my rows before displaying them, rather than acting like keyboard input and relying on the users to save the updates.

    I find it very difficult to identify the field names as on the page they seem to be part of a hierarchy which I cannot find a description for (e.g. id=”acf-field_609af70f9fdac-acfcloneindex-field_609af86f9fdb1″ name=”acf[field_609af70f9fdac][acfcloneindex][field_609af86f9fdb1] where the field ending in db1 corresponds to one of the coordinate fields I defined). This makes the coding more difficult.

    I hope I’ve not gone on too much, but thanks for your help anyway.
    row
    #

  • Thanks John, I didn’t realise the tooltip also had Add-row. Forgive my lack of experience with this, but you suggested using the append function, I assume to trigger your script to run, then the set method to update the fields created by the click. How did you get the update to run, another click?

    Many thanks

  • I added
    jQuery('[data-key="field_609af70f9fdac"] a[data-event="add-row"]').trigger('click');
    to my javascript, and instead of adding one row, it added 4 although in the chrome developer, it was only called once

    Any ideas?

  • City17, did you manage to get anything working? I’m just starting out trying to develop a frontend hotspot generator and need some code to add repeater fields with the coordinates of the hotspot. Any chance you could share some example code for me?

    Many thanks
    Pete

  • Micke, do you have an example I can see as I’m struggling trying to do the same thing.

    Many thanks
    Pete

  • My first approach with this was instead of using a relationship cpt, i’d use a repeater field in the photo table with a relationship pointer to the person and the other fields I need for each person. However, this approach was said to be wrong by other members of acf support.

    I can’t see any other way though.

  • noyram23, did you find any solution to this? I have a similar problem.

    Regards
    Pete

  • City17, did you manage to get anything working? I’m just starting out trying to develop a frontend hotspot generator and need some code to add repeater fields with the coordinates of the hotspot. Any chance you could share some example code for me?

    Many thanks
    Pete

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