The default tag tile only shows the last discussion. I want to show the 10 latest discussions.
I tried the following methods but found no answer:
I checked the properties of the tag object in the Flarum/Tags extension and found a method tag.lastPostedDiscussion() :
lastPostedDiscussion() {
return Model.hasOne<Discussion | null>('lastPostedDiscussion').call(this);
}
I tried to modify the Flarum\vendor\flarum\tags\js\src\common\models\Tag.ts file and added a method to get a array result, but it returned false after running.
allPostedDiscussion() {
return Model.hasMany<Discussion>('allPostedDiscussion').call(this);
}
I also tried to use this way: app.store.all('discussions').filter((discussion) => {} to traverse all discussions to match tags, but I haven't found how to get the tag property of each discussion.
Sorry the above is from Google Translate, if you have a solution please let me know