Replace property with value if empty before fronte...
# help-with-umbraco
x
Hi, I'm wanting to check if a property has been set, if not replace it a specified value. I see how to do this in the backoffice but not for the frontend. I did read the documentation and found this method which is invoked when I need it to be, but I have no idea how I can changed an IPublishableContent type using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Notifications; namespace Umbraco9.NotificationHandlers { public class PublishedRequestHandler : INotificationHandler { public void Handle(RoutingRequestNotification notification) { var requestBuilder = notification.RequestBuilder; // Do something with the IPublishedRequestBuilder here } } }
m
Would you not do this in your view, or businesslogic for the view, either using fallback or just a null/empty check logic? https://docs.umbraco.com/umbraco-cms/reference/querying/ipublishedcontent/properties#fallbacks
https://github.com/wholething fallback packages might be of use?
3 Views