How to show both states in a list


#1

Hello. I am trying to load a list some items with photos and some without. What script can I use to show both in the list. In this episode there is a script in the date tab for this I suppose. Can you share this with us. Best, Marcos


#2

You simply need to add “empty” list component and embed your main component inside that. Then change the embedded component state based on the value in Image prop. E.g. something like this:

if (typeof input !== ‘undefined’) {
if (input!=’’){
input=1; // if image exists then state is 1
} else {
input=0;
}
} else {
input=0;
}

return input;


#3

Thank you ver much. It worked