I have successfully been able to show/hide drag-and-drop content blocks on a cloudpage by doing the following:
- Adding an HTML block with opening IF statement
- Adding in a Image block with the image
- Adding another HTML block with closing ENDIF
In the builder, it looks like the image below:
This works fine on a cloudpage.
I am trying to do the exact same thing in an email built using content builder but I get an error saying there is a missing ENDIF.
Does this not function the same way in content builder for emails? Is there another way to do this?
I have gotten it to work by creating a content block with the content that I then reference, as below:
%%[ IF NOT EMPTY(AttributeValue('Recommendations')) THEN ]%%
%%=ContentBlockbyId("109174")=%%
%%[ENDIF]%%
However, this adds a bit of overhead with managing various content blocks outside of the email itself and would prefer to have it work the way I described above for the sake of my users.