IchHabRecht / content_defender

Define allowed or denied content element types in your backend layouts
GNU General Public License v2.0
81 stars 38 forks source link

FR: Respect disabled CEs and start/stop #112

Closed stbc closed 1 year ago

stbc commented 1 year ago

Hi everybody, it would be great if the extension could respect disabled CEs and, if possible, start/stop dates.

Disabled CE

Current behavior

If a column allows only one CE of type text, it is regardless, if the CE is enabled or disabled, you are not allowed to create a new one.

Expected behavior

If a CE is disabled, it is possible to add one new of that specific (if only one allowed) or any other allowed type to the column.

Respect start/stop

Current behavior

If a CE has a stop date, which is in the past, you are nevertheless not allowed to create a new one unless you deleted the CE.

Expected behavior

If a CE has a stop date in past, you can create a new one. Futhermore it would be great to have corresponding stop/start dates.

IchHabRecht commented 1 year ago

HI @stbc ,

Thank you for your ticket. Your "current behavior" description is exactly like I want content_defender to be working. Otherwise it would be allowed to create an overhead of elements with hidding/unhiding those elements. To care about any start/stop behaviour would drastistically complicate the functionality and I don't want to support this. Hope you understand my decision here.

stbc commented 1 year ago

Sure, it is your extension and your work ;)

I just came up with it fiddling around with a column that allows only 1 CE of a certain type and I wanted to automate the "show Christmas and New Years Whishes" and switch over to the other "normal" CE on January the 2nd.

But thats the way it is then...

stbc commented 1 year ago

Ah, forgot:

Wishing you a Merry Christmas and a happy New Year! :)

IchHabRecht commented 1 year ago

Same to you ;-) And maybe you can solve your problem by allowing 2 content elements for the next couple of days :-)