Is it possible to make "Remove at" a mandatory field?
I need to use the standard "remove at" field in my template so that I can make API function calls against it, but I also need it to be a mandatory field. If I create my own field, I can check the checkbox to make it mandatory, but you can't edit the default fields, so....
Any ideas? Do I need to create an event handler? I was looking for an easier solution first.
There is no built in way to make the remove at field mandatory, but maybe there are other alternatives. As you mention an eventhandler could be used to either reject the save if a date is not set, or you could set a default date like today + 30 days.
What are you planning to use it for exactly? You could consider adding you own datetime filed to the document type and make that mandatory, and simply filter out expired pages in your xslt xpath. Or maybe just copy the value from that mandatory field to the "remove at" field in an event handler.
Do you want the documents to get unpublished, or is that just a side effect?
There are a couple of reasons I prefer the built-in date field.
1. I DO want the content to unplublish automatically.
2. I'm using the Document.GetDocumentsForExpiration() method to auto-delete expired content automatically.
I've built a google maps page that renders each sub-content item as a point on the map using the location package. The points are related to temporary road closings, so they need to have expiration dates.
I can create another date field, but then I have 2 fields that pretty much do the same thing, and I can't use any of the built in API, or at least not in the way I prefer.
I think I'll create a ticket for this and see if it gets any votes.
Ok, I see the point in using the built in functionality. I would probably go with the eventhandler then and verify that there is an expiration date before publishing the document. Would be a fair workaround I think.
Is it possible to make "Remove at" a mandatory field?
I need to use the standard "remove at" field in my template so that I can make API function calls against it, but I also need it to be a mandatory field. If I create my own field, I can check the checkbox to make it mandatory, but you can't edit the default fields, so....
Any ideas? Do I need to create an event handler? I was looking for an easier solution first.
Thanks,
Ben
There is no built in way to make the remove at field mandatory, but maybe there are other alternatives. As you mention an eventhandler could be used to either reject the save if a date is not set, or you could set a default date like today + 30 days.
What are you planning to use it for exactly? You could consider adding you own datetime filed to the document type and make that mandatory, and simply filter out expired pages in your xslt xpath. Or maybe just copy the value from that mandatory field to the "remove at" field in an event handler.
Do you want the documents to get unpublished, or is that just a side effect?
There are a couple of reasons I prefer the built-in date field.
1. I DO want the content to unplublish automatically.
2. I'm using the Document.GetDocumentsForExpiration() method to auto-delete expired content automatically.
I've built a google maps page that renders each sub-content item as a point on the map using the location package. The points are related to temporary road closings, so they need to have expiration dates.
I can create another date field, but then I have 2 fields that pretty much do the same thing, and I can't use any of the built in API, or at least not in the way I prefer.
I think I'll create a ticket for this and see if it gets any votes.
-Ben
Ok, I see the point in using the built in functionality. I would probably go with the eventhandler then and verify that there is an expiration date before publishing the document. Would be a fair workaround I think.
Sounds like another reason for me to learn more about Umbraco event handlers. Thanks for the feedback.
is working on a reply...