Support

Account

Forum Replies Created

  • Hi Elliot,

    So the most recent update (5.7.12) seems to have resolved the images. I do still have the issue with using the name cards for the repeater in a flex block called cards, but honestly, renaming that in this case is fine.

    In regards to the cache, is there an SQL query I can run to clear it, like clearing transients?

    Thanks

  • To further this, I’ve created a new flex layout called Cards, so I have a template called content-cards.php. In here I have a repeater field called cards, this shows in the get_field_objects() but not when I use the usual ‘have_rows(‘cards’))’, however if I rename it to have_rows('card_blocks')) then it does. Again, the naming could be improved on my behalf, however these are things that worked prior to 5.7.11, so there’s defiantly some weirdness happenings still.

    Interestingly, in this repeater field I have an image field called image which is working. Not sure if it’s because the scopes different in a repeater, but may be of use.

  • Hi @elliot,

    No worries I’ve followed your steps above and updated, however the issue persists unfortunately.

    So here’s the output of get_field_objects():

    Array
    (
        [flex] => Array
            (
                [ID] => 52
                [key] => field_5c59ba9a49e2c
                [label] => Flexible Content
                [name] => flex
                [prefix] => acf
                [type] => flexible_content
                [value] => Array
                    (
                        [1] => Array
                            (
                                [acf_fc_layout] => text_image_card
                                [title] => About Example
                                [text] => Duis pulvinar sed mauris at tempus. Maecenas at dapibus nisi, sed congue velit.
                                [link] => Array
                                    (
                                        [title] => 
                                        [url] => https://example.test/
                                        [target] => 
                                    )
    
                                [image] => Array
                                    (
                                        [ID] => 82
                                        [id] => 82
                                        [title] => ladies
                                        [filename] => ladies.jpg
                                        [filesize] => 127509
                                        [url] => https://example.test/wp-content/uploads/2019/02/ladies.jpg
                                        [link] => https://example.test/home/ladies/
                                        [alt] => 
                                        [author] => 3
                                        [description] => 
                                        [caption] =>  
                                        [name] => ladies
                                        [status] => inherit
                                        [uploaded_to] => 19
                                        [date] => 2019-02-06 14:12:57
                                        [modified] => 2019-02-06 14:12:57
                                        [menu_order] => 0
                                        [mime_type] => image/jpeg
                                        [type] => image
                                        [subtype] => jpeg
                                        [icon] => https://example.test/wp-includes/images/media/default.png
                                        [width] => 800
                                        [height] => 800
                                        [sizes] => Array
                                            (
                                                [thumbnail] => https://example.test/wp-content/uploads/2019/02/ladies-150x150.jpg
                                                [thumbnail-width] => 150
                                                [thumbnail-height] => 150
                                                [medium] => https://example.test/wp-content/uploads/2019/02/ladies-300x300.jpg
                                                [medium-width] => 300
                                                [medium-height] => 300
                                                [medium_large] => https://example.test/wp-content/uploads/2019/02/ladies-768x768.jpg
                                                [medium_large-width] => 768
                                                [medium_large-height] => 768
                                                [large] => https://example.test/wp-content/uploads/2019/02/ladies.jpg
                                                [large-width] => 800
                                                [large-height] => 800
                                            )
    
                                    )
    
                                [text_side] => right
                                [card_colour] => navy
                            )
    
                    )
    
                [button_label] => Add Content
                [min] => 
                [max] => 
                [_name] => flex
                [_valid] => 1
            )
    
    )

    And so we have a flex file which routes to the relevant flex component:

    if (have_rows('flex')) {
        while (have_rows('flex')) {
            the_row();
            include locate_template('components/flex/content-' . get_row_layout() . '.php');
        }
    }
    

    And in my content-text_image_card.php file I’m using:

    $image = get_sub_field('image');
    $link = get_sub_field('link');

    $link works, $image doesn’t. If I change the name of the image field from image to card_image then get_sub_field('card_image'); works.

    As previously mentioned, the naming could certainly be better on my part, however it’s kind of set on a lot of our projects so changing now is a big job.

    Thanks

  • You’re right, sounds like the same issue. However I re-downloaded the updated version this morning which fixed an issue with out options page generated with register_field_group(), however this flexible content is created in WP admin, not from our code. The updates not resolved this issue for me unfortunately.

  • That worked a treat! Thanks!

    For anyone else viewing this, you can find the field key by inspecting the input element on your post.

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