Show element only if it contains content

I have a page of user data being displayed on my page. One of the fields is “comments” which sometime will contain data and often will not.

How can I hid this if there is no content
or
show it if there is content

I have read the dynamic attribute articles which are obviously very powerful but all the ones I have found relate to show / hiding based on other criteria.

I have used Word Count for this

image

Just use the comments binding as a condition for the dmx-show attribute.

Hi Ben / Teodor, I am unclear as to how to make the element hidden by default (column with paragraph).

I assume I then use “show” using either word count as the criteria or alternatively the binding as a condition.

Use the ‘Show’ action and in the condition just put the variable.

Many thanks for the helpful contributions - I was making life difficult for myself where in reality it was really easy :slight_smile: Wappler’s easy of use strikes again.

Thanks again…

1 Like