# Setting to include excluded categories in homepage on mobile

**URL:** <https://meta.discourse.org/t/setting-to-include-excluded-categories-in-homepage-on-mobile/50769>\
**Category:** Feature\
**Created:** [2016 年9 月 28 日 03:00 UTC](https://meta.discourse.org/t/setting-to-include-excluded-categories-in-homepage-on-mobile/50769 "2016-09-28T03:00:43Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)\
发布日期： [2016 年9 月 28 日 03:00 UTC](https://meta.discourse.org/t/setting-to-include-excluded-categories-in-homepage-on-mobile/50769/1 "2016-09-28T03:00:43Z")

</div>

Would it make sense to add a setting that only excludes categories from the homepage on desktop clients? Or would this be something that should be handled in a plugin?

Some context: I am building a Discourse site with an un-Discourse-like layout for the topic lists. My layout has a sidebar that lists the latest posts from several categories that are excluded from the homepage. Since the sidebar is only for desktop, topics from the sidebar categories are excluded from mobile as well, and I would like to show them in mobile.

I would be happy to do this within my plugin, if it is doable. I am a newbie in Ruby, but I did find where the [filtering of excluded categories](https://github.com/pmusaraj/discourse/blob/master/app/controllers/list_controller.rb#L63-L65) is done and I tested quickly adding a check for mobile\_view there, and it works. I just added the `unless` statement below:

```
if filter.to_s == current_homepage
  unless view_context.mobile_view?
    list_opts[:exclude_category_ids] = get_excluded_category_ids(list_opts[:category])
  end
end

```

But, help, I don’t know how to do this from within the plugin.

---

_[View the full topic](https://meta.discourse.org/t/setting-to-include-excluded-categories-in-homepage-on-mobile/50769)._
