Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hooks for content #1511

Closed
tidyui opened this issue Feb 23, 2021 · 6 comments
Closed

Add hooks for content #1511

tidyui opened this issue Feb 23, 2021 · 6 comments
Assignees
Milestone

Comments

@tidyui
Copy link
Member

tidyui commented Feb 23, 2021

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

@jensbrak
Copy link
Contributor

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. :)

@tidyui
Copy link
Member Author

tidyui commented Feb 23, 2021

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

@tidyui
Copy link
Member Author

tidyui commented Feb 24, 2021

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

@tidyui
Copy link
Member Author

tidyui commented Feb 24, 2021

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

@jensbrak
Copy link
Contributor

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.

@jensbrak
Copy link
Contributor

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>();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants