• Resolved johnzenausa

    (@johnzenausa)


    I have show when empty set to no (that is not selected) and it hides the block itself but the wrapping div is still be displayed even though it’s empty.

    This image will explain better.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author WPLake

    (@wplakeorg)

    Hi @johnzenausa

    Yes, this is normal behavior when the “show when empty” switch is off.

    What seems to be the problem?

    Thread Starter johnzenausa

    (@johnzenausa)

    No real problem except for the fact it’s creating unnecessary html if the field is not in use. Of course I could just not add the shortcode to a page but I’m putting it in a template. If it can not display the other html when the ACF is empty why not have this div not displayed also?

    Excellent plugin btw and thank you for creating it.

    Plugin Author WPLake

    (@wplakeorg)

    @johnzenausa What type of field are you using?
    Because we’ve tested and it works with plain text field types.

    Please note we will soon release an update turning HTML into TWIG.

    Thread Starter johnzenausa

    (@johnzenausa)

    @wplakeorg Basically all fields including Google maps. Displays them all beautifully. Creating a business charity directory for a client and this plugin saves me a lot of coding.

    Plugin Author WPLake

    (@wplakeorg)

    @johnzenausa We’ve released ACF Views version 2.0 today.
    Could you please run a test on your site, and see if the Div is still being added to the page when field is empty?

    Thread Starter johnzenausa

    (@johnzenausa)

    Hi @wplakeorg

    The div is still showing because when you look at the markup code below:

    the if statement is inside the surrounding div. It goes div >> if statement >> div. So the inside div is hidden but the surrounding div still show. Is it possible to move the if statement outside both divs so neither one will show if empty?

    Here is another example in this image:

    Thanks John

    • This reply was modified 1 year, 2 months ago by johnzenausa. Reason: To add second image
    Plugin Author WPLake

    (@wplakeorg)

    Hi @johnzenausa

    We understand what you mean. This could be a valuable feature for some.

    We’re going to include something in a future release to control this behaviour. We’ll keep you posted.

    Thread Starter johnzenausa

    (@johnzenausa)

    Thank you ??

    Plugin Author WPLake

    (@wplakeorg)

    Hi @johnzenausa

    In the latest ACF Views (v 2.1.0 released yesterday) it is now possible to prevent the template from rendering when it’s empty. See the setting at the bottom of the “Markup” tab in your Views.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘ACF Views Div Still Showing’ is closed to new replies.