How to delete the first item from list?

Hello. Can you help me please to solve interesting problem. I have a list of items (it’s photos). I want to allow users edit this list. But I want for the field stay empty after delete, but currently this place fill previous item. I understand it’s happens because I display the item#1. But how to make after delete fist item stay empty? Maybe have a way to do this. Thank you


If I understand your question correctly, it looks as though you currently have a field on the ‘Master’ Datatype, which is a list of images, then you’re displaying the first of those images in the image element…

If the first image from the list is deleted then, of course, what was the second image will then become the first image, so that’s what will now be displayed in the first image element.

In order to achieve what you’re trying to achieve, you’re going to have to modify your database structure slightly.

First, you’ll need to create a Datatype called Portfolio_Image (or just Image, or something similar), and then have a field on the Master Datatype that is a list of Portfolio_Images

Each Portfolio_Image should have an image field, as well as fields for any other relevant data.

Set your image element up to display the Parent Group’s Masters Portfolio_Images: item #1’s Image. (or better yet, use a RG to display all the Portfolio_Images).

When ‘deleting’ an image, rather then removing the Portoflio_Image from the parent group’s Master, just make changes to the Portfolio_Image and leave the image field empty (you can also delete the image file if you want/need to).

That way, each image element will always display either the image from it’s corresponding Portfolio_Images (if there is one), or it will remain empty, but it will never display an image from another Portfolio_Image.

This topic was automatically closed after 70 days. New replies are no longer allowed.