Extending ISetupEventHandler with new events, your DotNest site (almost) never goes down - This week in Orchard (22/09/2023)
Extending ISetupEventHandler with new events, do not specify placement position in the content field/part display drivers, and a blog post about the reliability of your DotNest sites! Let's see the details in our post!
Orchard Core updates
Extending ISetupEventHandler with new events
We have an ISetupEventHandler interface in Orchard with a method called Setup. When there is a setup on a new tenant, we call this method. Now this method is marked as an obsolete one and will be removed in future releases. If you rebuild your Orchard Core solution in the future, it will tell you to use the new SetupAsync instead. If you have an implementation of this interface, it will still work because the newly added FailedAsync and SucceededAsync methods have default implementations. It means you don't need an abstract base class.
Do not specify placement position in the content field/part display drivers
Content elements or fields can be attached to a content type. Their UI placement should follow the subsequent guidelines. So, if the first step defines a position, we use that position and look no further.
- DisplayDriver.
- A placement is defined on the UI using the OrchardCore.Placements.
- The placements.json file.
- Default Position in the content type.
- Otherwise, it should fall back to the physical placement of the object in the content definition.
For this logic to work as expected, the ContentPartDisplayDriver or the ContentFieldDisplayDriver should define a placement location by default, but not a placement position. This way, we can allow to change the order using Steps 2-5 as needed.
In the following drivers, we seem to be defining a placement position that prevents the user from being able to change that position at all.
- FacebookPluginPartDisplayDriver
- BagPartDisplayDriver
- FlowPartDisplayDriver
- HtmlBodyPartDisplayDriver
- LiquidPartDisplayDriver
- MarkdownBodyPartDisplayDriver
- TaxonomyPartDisplayDriver
- TitlePartDisplayDriver
For example, today if you use HtmlBodyPart, there is no easy way to change its placement because the HtmlBodyPartDisplayDriver defines a position 5. Meaning if you have a placement in the driver, there is no easy way to override it from the UI. If we leave these positions, blank it will fall back to the user settings.
News from the community
Your DotNest site (almost) never goes down
Orchard Core and Orchard 1.x sites you host on DotNest almost never go down, with 99.99% availability in the last 3 months. Check out the details in our latest blog post here.
If you haven't done it already and want to host your sites on the hugely reliable DotNest, create your site here! We also guarantee reliability in our Terms of Service.
Orchard Dojo Newsletter
Lombiq's Orchard Dojo Newsletter has 505 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course.
Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here!