Piranha.core: Add hooks for content

Created on 23 Feb 2021  路  6Comments  路  Source: PiranhaCMS/piranha.core

The classic hooks (OnLoad, OnBeforeSave, OnAfterSave, OnBeforeDelete, OnAfterDelete) should be available for content.

core enhancement

All 6 comments

Does the content hooks work (or rather should they work) the same as for pages, posts and comments? If so, I might have a go on this one if no one beats me to it (I'm messing around with similar stuff anyway).
I'll add a heads up if I do so and if I don't I haven't done anything either. :)

As we're not changing the implementation at this point they should work exactly the same as for pages & posts!

The base class for content is GenericContent. ContentBase is the base for all content (Content/Pages/Posts/SiteContent)

It was all very clear until we introduced a top level model with Content in its name :P

Ah, kinda suspected that but good to know.
Work done (not much code I know) but I'm adding a couple of test cases too and running some manual tests in addition.

In core/Runtime/HookManager.cs add a property for GenericContent hook:

        /// <summary>
        /// Gets the hooks available for generic content.
        /// </summary>
        public ServiceHooks<GenericContent> GenericContent { get; } = new ServiceHooks<GenericContent>();
Was this page helpful?
0 / 5 - 0 ratings

Related issues

rengert picture rengert  路  3Comments

SamBray picture SamBray  路  3Comments

aneff-official picture aneff-official  路  3Comments

aneff-official picture aneff-official  路  4Comments

OmidID picture OmidID  路  3Comments