10 Posts
Nathan
1 year ago
14
Topic

How to make the following possible... Some content types have image or file fields. How can I delete those images/ files if I delete the content? So no images and files are left behind. Is this possible out of the box? If no - what would be necessary to make this work? TIA.

100 Posts
ricco
11 months ago
0
Level 1

Yes, I'd like to know the answer of this too.

It is very important issue specially for bigger projects.

Thank you

27 Posts
Skepsis
11 months ago
0
Level 1

Hello,

I´m also very interested in a solution for this problem.

Greetings
Skepsis

18 Posts
casino83
11 months ago
0
Level 1

Same here... A plugin would be very useful!

11 months ago
0
Level 1

Hi everybody and thanks.

A solution can be to add an option in the upload field only when the option "1 Folder / Content" is on Yes. Because in this case only there is a link between the image and the content.

Please add a feature request in the tracker.

Regards

97 Posts
pixelneco
11 months ago
0
Level 1

Hi Sebastien,


thank you for the hint. I always use "1 Folder / Content -> Yes" but there is an other problem. For example on image upload, when i delete one image via checkbox (not the whole content, just one specific), all thumbnails are deleted except "image". So the thumbnail folders are empty, but not the content image folder.


kind regards

100 Posts
ricco
11 months ago
2
Level 1

Hi friends,

I've added a feature request in the tracker here: http://www.seblod.com/resources/tracker/5223

Meanwhile does anybody have a temporary solution for this issue.

Bes wrote:

A solution can be to add an option in the upload field only when the 
option "1 Folder / Content" is on Yes. Because in this case only there 
is a link between the image and the content.<br>

Bes you are talking about some kind of solution but could you please explain how exactly this can happen.

Thank you and best regards

10 months ago
1
Level 2

Hello,

At first to clarify, there is no solution actually such as in Joomla. When you delete a Joomla article with some pictures in it, theses pictures are not deleted. And it's good like this!

To imagine to delete an image included into a content when this content is deleted itself require to have a strong relation between the content and the image and to be sure that no other content are using this image.

There is not many case when the relation exist. It's the case when the SEBLOD image upload field save an image in a specific directory related to the content. In this particular case, we can think to add an option to delete the image too because the file of this image is only used for this content (because the file of the image is stored into a specific directory related to this content).

Another case it's when we're speaking about DAM. In few time you will be able to have a look on a DAM system build only with SEBLOD.

Regards.

100 Posts
ricco
10 months ago
0
Level 3

Hi Bes,


We know it's going to be difficult, but it's important. For 2 months I already have about 1000 ads on my site with up to 4 images each and up to 1 file attachment each. Just imagine in 1 or 2 years what will happen if I cannot delete the assets of the deleted ads.


You've done the hard job making such an extension as SEBLOD, please make some more effort.


I think SEBLOD is already standing out from the rest, but the possibility to delete the content together with the associated assets would make it even much, much stronger.


I've past my abilities to learn PHP, I'm too old for that. If you don't want money say what you need? Do you want me to search for some similar code so it can be easier for you to implement it?


Please take the time and make available some solution, even if we can delete the assets only after we select the option: 1 directory/folder for the assets (images/files) per content/article.


Thank you
Best regards
Ricco

100 Posts
ricco
10 months ago
0
Level 1

Hi again,


At least is there a way to be notified when a content is deleted?


If we are able to receive an email when a content is deleted, with the id of the deleted content we can delete the assets manually, but I'm wondering how this could happen.


May be someone already knows?


Thank you

All the best

Ricco

10 Posts
Nathan
10 months ago
0
Level 1

Hi Bes and others, Thx for al your replies and thinking along. Conclusion for now... it can't be done out of the box. Though, the idea / feature whish might be an interesting one. 


Looking forward to see that DAM. (Had to look that up: http://www.contentmanager.eu.com/dam.htm)


Some thoughts after your input, the written whishes, etc.  (just thoughts!) ;-)

Every image should become a piece of content of a IMG content-type-item. Those content type items should be linked exclusively or non-exclusive to other content items. This might be done through describing the relation with a checkbox. Exclusive (part of the linked content-item), non-exclusive. In the first case the image will be deleted too if the content item is deleted. 


This way there's always a relation between the image and some 'meta data' in de database (inclusive a unique ID for the image). 


Storage of images

Only if we want to keep the original name of an image file, or store it in a 'natural' hierarchic way:
Images should be stored for each Content Type in its own media folder, but each content Item should also have its own folder. 

For example a content type 'house' (Real Estate) or 'car' (Occasion car sales) - these items will have more then one image or PDF brochure. So, (optional) this could be the structure: images/cck/[cck-type]/[content-id]/

For ex. the media-folder-name for a 'house' with ID 2349:   images/cck/house/2349/
That folder (2349) will contain all the media for this house and whenever the house can be deleted, there's a relation.


If besides database-entries also assets (images, video's, etc.) can become part of a Content Item, and only of that item, might indeed take a CCK to a next level. It's upgrading the definition of Content. Or am I too enthusiastic here about features that already exist? ;-)


Another thought... I think that this should be standard behaviour for assets which are part of a Content Item. Think about it...  it makes the most sense. Make the asset just as much part of the content as the title and description. On the other hand... it might be configurable by an option 'relation'. 
1) asset has a link with 1, and only 1 content item (default)
2) asset has a link with 0, 1 or more content items.


Again… just some thoughts. 


How does this work in Drupal? Anyone? It's fair to say that Drupal has quite some history and experience with their CCK / Views. We can learn from it how to (not) do it, improve etc. Perhaps another time some research. My post is way toooo long already ;-)

100 Posts
ricco
9 months ago
0
Level 1

Hi,


I think I've found a temporary workaround of the problem it's not great but at least you can manually delete the assets.


Please see my last post in this topic.


The problem unfortunately remains if the user deletes the articles himself. I'm thinking how to make the content to get to trashed state instead of being deleted permanently with the Free text delete plugin.


Regards

Ricco

100 Posts
ricco
8 months ago
1
Level 1
Hi,

Finally I've found a way to be notified when an article is delete.

It's this plug-in which helped me Content Update Notifications Plugin.

It's not the best solution to the problem but at least now I receive an email with the article id when a user deletes an article and I know which assets to remove manually.

Regards
Ricco
307 Posts
joomleb
8 months ago
0
Level 2
Many Thanks for suggestions.
I think this feature is so a must that really can not understand how could do to survive large projects with Seblod till today without this feature...
106 Posts
terveg
2 months ago
0
Level 1
please feel fre to vote for this in tracker :)