Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1466356

    Hi,
    The new Dynamic Content feature is great and I’m almost able to do what I need to do with it but I’m having one issue I can seem to figure out.

    If an ACF field is empty for a given product how I can I not show something on the page?
    For example suppose I have a product with a Width, Height, and Depth and maybe a Seat Height as well. If the ACF field in my item for Seat Height is empty how can I not show that text?
    W: {acf_field_66d78b98f0590:Width}
    H: {acf_field_66d78bfaf0591:Depth}
    D: {acf_field_66d78bfff0592:Height}
    SH: {acf_field_66d78c05f0593:Seat Height} – how can I not show this line if the field has no value?

    I can try to work around this in text element if I must and just deal with “SH: ” with nothing after it but the gallery is where I have the bigger issue.

    I setup 6 images in ACF but not all products will have 6 images, some may only have say 3. If a Gallery or Masonry Gallery element and have
    {acf_field_66d78c7bf0598:Image 1},{acf_field_66d78cffcf04d:Image 2},{acf_field_66d78d1acf04e:Image 3},{acf_field_66d78d26cf04f:Image 4},{acf_field_66d78d2fcf050:Image 5},{acf_field_66d78d3ad73a4:Image 6} for Custom Field Gallery Images the gallery breaks if I have less than 6 images and is just showing random images from the media library. If I put 6 images on the product/item then the gallery works.

    #1466370

    Hey karirak73,

    Thank you for the inquiry.

    Unfortunately, the dynamic content feature doesn’t support conditional functions. Have you tried using the Conditional Logic feature of ACF fields? You could also apply a default value to the fields, such as a placeholder image, so the gallery won’t break if an item is missing.

    Best regards,
    Ismael

    #1466410

    Thanks for your response Ismael! I can’t see how the Conditional Logic feature of ACF fields would help me as that shows and hides ACF fields on the actual post. I will have to come up with another solution as the client wont’ be happy with placeholder images appearing. At the very least it seems that if an image field in the gallery is empty it should just not show that image rather than break the gallery.

    #1466453

    Hi,
    Glad that Ismael could help, unfortunately the placeholder images can not be empty, perhaps if you use the Conditional Logic feature of ACF fields to specify a specific image you could use css to hide that image, otherwise another solution will be needed.
    If you need further assistance please explain further with links and screenshots so we can help.
    To add a screenshot please try using an Screenshot service and pasting the image URL in your post.

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.