luceos justshipit The difficulty with this task is that even if there's a dedicated method to get the "records" to display (In PostStream we can easily monkey-patch the posts()
), the creation of a Mithril component still happens in the view()
method.
So to add a custom block we need either: register some custom Component into Flarum (that's possible for posts because new post types are allowed) or rewrite the view()
method completely in the extension...
In the case of the list of discussion there's not even a discussions()
methods to monkey patch... The only way seems to change the view()
...
@luceos Maybe we should separate these methods in core for easier monkey-patching. Have a postsComponents()
or discussionsComponents
that takes the list of records for posts()
or this.discussions
and return a list of Mithril components. That would be the one to monkey-patch if we want to push custom components that are not stored in the database records.
For reference, that's where the list of records get turned into components: