diff --git a/app/assets/javascripts/discourse/components/navigation-item.js.es6 b/app/assets/javascripts/discourse/components/navigation-item.js.es6
index 9ee2e389059..888eb3c28ca 100644
--- a/app/assets/javascripts/discourse/components/navigation-item.js.es6
+++ b/app/assets/javascripts/discourse/components/navigation-item.js.es6
@@ -16,7 +16,18 @@ export default Ember.Component.extend(bufferedRender({
buildBuffer(buffer) {
const content = this.get('content');
- buffer.push("");
+
+ let href = content.get('href');
+
+ // Include the category id if the option is present
+ if (content.get('includeCategoryId')) {
+ let categoryId = this.get('category.id');
+ if (categoryId) {
+ href += `?category_id=${categoryId}`;
+ }
+ }
+
+ buffer.push(``);
if (content.get('hasIcon')) {
buffer.push("");
}
diff --git a/app/assets/javascripts/discourse/templates/components/navigation-bar.hbs b/app/assets/javascripts/discourse/templates/components/navigation-bar.hbs
index 256ab2af040..0808efcc6d5 100644
--- a/app/assets/javascripts/discourse/templates/components/navigation-bar.hbs
+++ b/app/assets/javascripts/discourse/templates/components/navigation-bar.hbs
@@ -1,5 +1,5 @@
{{#each navItems as |navItem|}}
- {{navigation-item content=navItem filterMode=filterMode}}
+ {{navigation-item content=navItem filterMode=filterMode category=category}}
{{/each}}
{{custom-html name="extraNavItem" tagName="li"}}
{{!- this is done to avoid DIV in the UL, originally {{plugin-outlet name="extra-nav-item"}}
diff --git a/app/assets/javascripts/discourse/templates/mobile/components/navigation-bar.hbs b/app/assets/javascripts/discourse/templates/mobile/components/navigation-bar.hbs
index f52a6b16ca8..884ceb75d4c 100644
--- a/app/assets/javascripts/discourse/templates/mobile/components/navigation-bar.hbs
+++ b/app/assets/javascripts/discourse/templates/mobile/components/navigation-bar.hbs
@@ -7,7 +7,7 @@
{{#if expanded}}
{{#each navItems as |navItem|}}
- {{navigation-item content=navItem filterMode=filterMode}}
+ {{navigation-item content=navItem filterMode=filterMode category=category}}
{{/each}}
{{/if}}