Replies: 1 comment 3 replies
-
The workaround I suggest is still something you can use today, and nothing was implemented so far.
If we do that, we'd have to do To me an API such as this one is more flexible, supports both use cases at the same time, and in sync with other API designs we already have. And you can more easily parallelize work instead of executing your code/our code sequentially. async function loadContent(params) {
console.log('before');
const content = params.defaultLoadContent(params);
console.log('after');
return content;
},
This is already what is suggested in the other issue, so this idea is not really new. What we need is someone to invest time and design a proper API for that feature. It doesn't make sense to let users only extend this hook. All plugins support this hook and many more hooks, so what kind of generic API could we create to enable users to extend all hooks.
Those are the questions to answer if we want to make progress on this |
Beta Was this translation helpful? Give feedback.
-
I'm trying to find a way to add some actions after the blog
contentLoaded()
function is executed, in order to create some global data to be used in custom pages (like my chronology table displayed in the home page).From #4138 (comment) I understood that one possible suggestion is to create a new plug-in based on the existing plug-in, and to rewrite the
contentLoaded()
function to first call the originalcontentLoaded()
then do the custom actions. There were also several discussions related to some middleware, but it is not clear if any were implemented.Is this still the best solution available in 3.1?
I'm also wandering why not extend the plug-in loader, and call a hook (like
afterContentLoaded()
, with the same arguments), if available in the plug-in configuration?Beta Was this translation helpful? Give feedback.
All reactions