I have created a list where people can advertise rooms or flats that they are renting out... but i have one slight issue, namely, that the items that "expire" in terms of the available dates will have to be removed manually by me for now.
Not a problem as long as the list is not to extensive, but if it works in the long run, I wanted articles in the list to become invisible or deleted itself once the "available until" date is passed...
Yes Ricco, the solution is to used the Joomla publish down date. But not obvious if you have already some contents because this field has certainly not the same storage as yours (you can just import date in com_content table).
To trash a content the state must be set to -1. It can be done on a submission form by adding the state field and put the default value to -1 (this field can be related to a field conditional rule). On a SEBLOD list you can insert a "delete" link by using the link plugin "delete" on a free text field (write "delete"). In this last way the deletion is definitive (not trashed).
To schedule the delete action it's require some other stuff.
I've read your post again and again but I'm sorry I couldn't clearly understand you.
I know it's not good to change the core fields that's why I proposed to Filip to make a new field with the same setting as the field "Article Publish Down (Calendar)" in which case the users will be able to pick an expiration date of the content/ad/article and that date will be saved in the published_down column in the com_content table. The problem with this filed is that it's just a calendar field without the possibility to limit the future period. I would prefer to have may be a simple select with some options e.g. 7 days, 10 days, .... Is this possible and how please?
I hope it's not that difficult for you to explain in details how to schedule the delete action. Once you write it it will be available for the community in the future and you will not need to think about it any more. It may even get further developed by other users or you may get an idea until you are describing it :-). I know it can take you 15-20 minutes but hey it's going to be available for years after that for the whole community.
I'm just thinking if this could be done like in this example:
(Please note that I don't know what the options for the statuses are, could you at least tell them to us? Now I see that you are saying that -1 is for trashed, but after I trashed an article and checked its "state" in the "com_content" it's -2. Did you make a mistake, or is it something else wrong here?)
1. we create a field simple select e.g. "states" with 3 options: "trash=-1", "unpublish=0" and "publish=1", as: -1 being for trashed, 0 being for unpublished and 1 for
2. we create 3 text fields with names: "state_trash" "state_unpublish" "state_publish" and default values -1, 0 and 1, with storage "state" in the "com_content";
3. then we assign a conditional rule to each text field from #2, something like for example for the "state_trash": This field is enabled if "states" is: -1, and another rule to the same field: This field is disabled if "states" is: 0,1
I'm so happy that I've found a workaround of this problem I'd like to share it. This is also double trouble saver and a workaround for the problem with the deleting the assets together with the content discussed in this topic. Here it is:
I've used the variation Mehdi proposed (thank you very much Mehdi Baba) on this topic to set the Published down date of my contents.
And yahooooo now I have all of my ads which expired as trashed so I can delete them and also see which assets to remove.
Great, super, I so worried about this
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.