Hi guys
I am just trying now to add css class name to body e.g. class="App" by using current selected tag slug. Using IndexPage.prototype works well, but not on DiscussionPage.protoype since tag.slug is not accessible through this component.
The idea behind it is to allow dev design each page differently depending on tag. This means I could design tag blog differently and their posts too.
Here is the code I tried directly in the file addTagFilter.js of component flarum-ext-tags which worked on IndexPage :
extend(IndexPage.prototype, 'view', function(view) {
const tag = this.currentTag();
if (tag) {
this.bodyClass += ' ' + tag.slug();
}
});
Do you have any idea how to solve this on DiscussionPage? Any help appreciated!
Thank you