Community X.

Connect with other creators, share ideas, give feedback and get the latest product updates.

Feb 12
Edited: Feb 12

Creating Content Collections With Empty Fields

I am trying to create a dynamic page and I would like to be able to hide some elements if there is no data in the Content Collection.

I am able to almost completely hide anything using min-max on the grid and setting it to min-content and max-content, but if I have an image field then the image shows a broken link logo and textboxes still occupy some space even if they are empty.

Anyone has a solution for this?

2 answers2 replies
Best Answer
Feb 12

I think this might help you:

Thanks! one more question if you can help me, im trying to access and change an elements margins from code. not sure how to do that.

Feb 18Edited: Feb 18

@Jonathan Elhalal I do not think it is possible.

But you can do something else.

You can use animation to move the element as much as you want.

You can do this with wixAnimation.

For example:

import wixAnimations from 'wix-animations';

$w('#button').onClick(() => {
        .add($w('#your-element-id'), { x: -50, duration: 300 })


Feb 13

You can put some lines of code in to check if data element in collection is empty and hide or collapse element.

Editor X

Design your boldest creations.