• Resolved Marco

    (@michelyweb)


    Hey, i love this plugin!
    One thing is a problem for me though:

    The videos are attached to posts by an ACF repeater with a file field inside.

    In Oxygen Pagebuilder i use a Codeblock for adding a Video Gallery to the Post Template:

    print do_shortcode("[KGVID gallery_id=\"" . get_the_ID() . "\" gallery_orderby=\"meta_name\" gallery=\"true\" gallery_end=\"next\" gallery_per_page=\"false\" gallery_title=\"true\"][/KGVID]");

    Also I tried using “gallery_include” instead of “gallery_id”, but the sort order oft the ids is ignored.

    Any ideas how i can use the sorting from the ACF for the video gallery?

    • This topic was modified 3 years, 9 months ago by Marco.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Kyle Gilman

    (@kylegilman)

    So that Codeblock makes a gallery but it’s not sorted the way you want them to? I don’t know what an ACF repeater is, so you’ll have to walk me through the process. How do you want them to be sorted?

    Thread Starter Marco

    (@michelyweb)

    @kylegilman acf repeated fields can be sorted via drag and drop inside the post form. I think the reason is, that KGVID uses the fields of the attachment for sorting. so i try to add a sorting field to the video attachments and use it for sorting.

    Plugin Author Kyle Gilman

    (@kylegilman)

    Since Repeaters are a premium add-on for ACF I can’t test this. ACF appears to keep repeater fields in an array with indexed keys that maintain the order the user has selected but I’m not sure how my plugin would get that information. https://www.advancedcustomfields.com/resources/how-to-sorting-a-repeater-field/

    I think the simplest solution would be for my plugin to maintain the order of IDs in the gallery_include parameter. If that parameter is used, then I’ll change the default sort to match it. The next update will have that functionality. I’ve created an issue on Github so you can track my progress.

    Thread Starter Marco

    (@michelyweb)

    I think the simplest solution would be for my plugin to maintain the order of IDs in the gallery_include parameter. If that parameter is used, then I’ll change the default sort to match it.

    That’s perfect and you’ve published that update already! Thank you @kylegilman !!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sorting Video Gallery of files attached due ACF Field’ is closed to new replies.