Since a few years now, Discourse has support for higher level of depth in the category tree (with the max_category_nesting setting).
Would it be possible to show the highest-level parent category logo (and name) within this extension? Or at least support up to 3 level deep categories (That's the max level supported by the discourse community for now).
E.g. in https://github.com/naidihr/discourse-category-headers/blob/8266ad8458b45d9384a2c6149c22fd22cc0a79ec/common/header.html
Could probably end-up like (but I have now idea of how the extension work so please let me know how I can help):
function logoImg() {
const parentCategory = category.parentCategory;
const grandParentCategory = parentCategory && parentCategory.parentCategory;
if(settings.show_category_logo) {
if (category.uploaded_logo) {
return [h('img',{"attributes" : {"src" : category.uploaded_logo.url}})];
} else if (settings.show_parent_category_logo && parentCategory && parentCategory.uploaded_logo) {
return [h('img',{"attributes" : {"src" : parentCategory.uploaded_logo.url}})];
} else if (settings.show_parent_category_logo && grandParentCategory && grandParentCategory.uploaded_logo) {
return [h('img',{"attributes" : {"src" : grandParentCategory.uploaded_logo.url}})];
}
} else if (settings.show_site_logo && siteSettings.logo_small) {
return [h('img',{"attributes" : {"src" : siteSettings.logo_small}})];
}
}
Since a few years now, Discourse has support for higher level of depth in the category tree (with the
max_category_nestingsetting).Would it be possible to show the highest-level parent category logo (and name) within this extension? Or at least support up to 3 level deep categories (That's the max level supported by the discourse community for now).
E.g. in https://github.com/naidihr/discourse-category-headers/blob/8266ad8458b45d9384a2c6149c22fd22cc0a79ec/common/header.html
Could probably end-up like (but I have now idea of how the extension work so please let me know how I can help):