mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
FEATURE: Introduce 'Subcategories with featured topics' view (#16083)
This categories view is designed for sites which make heavy use of subcategories, and use top-level categories mainly for grouping
This commit is contained in:
@ -23,11 +23,14 @@ class CategoriesController < ApplicationController
|
||||
|
||||
parent_category = Category.find_by_slug(params[:parent_category_id]) || Category.find_by(id: params[:parent_category_id].to_i)
|
||||
|
||||
include_subcategories = SiteSetting.desktop_category_page_style == "subcategories_with_featured_topics" ||
|
||||
params[:include_subcategories] == "true"
|
||||
|
||||
category_options = {
|
||||
is_homepage: current_homepage == "categories",
|
||||
parent_category_id: params[:parent_category_id],
|
||||
include_topics: include_topics(parent_category),
|
||||
include_subcategories: params[:include_subcategories] == "true"
|
||||
include_subcategories: include_subcategories
|
||||
}
|
||||
|
||||
@category_list = CategoryList.new(guardian, category_options)
|
||||
@ -377,6 +380,7 @@ class CategoriesController < ApplicationController
|
||||
params[:include_topics] ||
|
||||
(parent_category && parent_category.subcategory_list_includes_topics?) ||
|
||||
style == "categories_with_featured_topics" ||
|
||||
style == "subcategories_with_featured_topics" ||
|
||||
style == "categories_boxes_with_topics" ||
|
||||
style == "categories_with_top_topics"
|
||||
end
|
||||
|
Reference in New Issue
Block a user