# View only category

**URL:** https://meta.discourse.org/t/view-only-category/60626
**Category:** Feature
**Created:** [April 8, 2017, 1:59am UTC](https://meta.discourse.org/t/view-only-category/60626 "2017-04-08T01:59:19Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![Miro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miro/32/66156_2.png) [@Miro](https://meta.discourse.org/u/Miro)
#### Post date: [April 8, 2017, 1:59am UTC](https://meta.discourse.org/t/view-only-category/60626/1 "2017-04-08T01:59:19Z")

</div>

Would it be possible to set category permission so everyone can see the category and introduction post but not the other posts. After reading the intro they can for example subscribe and see the other posts.

[https://meta.discourse.org/t/regarding-category-permission-setup/16945](https://meta.discourse.org/t/regarding-category-permission-setup/16945)

Sometimes information is confusing. I find old posts as this one where it say it can’t be done, but then I find new ones where it is added.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 8, 2017, 2:26am UTC](https://meta.discourse.org/t/view-only-category/60626/2 "2017-04-08T02:26:43Z")

</div>

This request makes no sense. Describe why anyone would want this behavior please, with examples.

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [April 8, 2017, 2:55am UTC](https://meta.discourse.org/t/view-only-category/60626/3 "2017-04-08T02:55:03Z")

</div>

Probably _not_ the reason @Miro wants it, but I could see that being very useful for the discussion of anything that makes people feel squeamish. The introductory post about the category can warn you away from the content inside, if it is something that will not sit well with you.

---

<div class="post-metadata">

### Author: ![Miro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miro/32/66156_2.png) [@Miro](https://meta.discourse.org/u/Miro)
#### Post date: [April 8, 2017, 5:47am UTC](https://meta.discourse.org/t/view-only-category/60626/4 "2017-04-08T05:47:32Z")

</div>

There is a great need for that.

If want someone to subscribe to the forums category, how he will know what is inside if he can’t even see the category or titles of the posts.

For example I have instructions how to do something , they are free. 20% people can use it but remaining 80% because of complexity can not. I do not want to waste time with detailed explanation and specific questions. Who needs such level can subscribe and get it.

SMF forum has “view only boards mod” where everybody can see category and post titles then they decide if they want to subscribe. Only in that section support for particular product is provided.

---

<div class="post-metadata">

### Author: ![scombs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scombs/32/48616_2.png) [@scombs](https://meta.discourse.org/u/scombs)
#### Post date: [April 8, 2017, 6:22am UTC](https://meta.discourse.org/t/view-only-category/60626/5 "2017-04-08T06:22:21Z")

</div>

This has come up before [here](https://meta.discourse.org/t/feature-allowing-a-private-category-to-be-seen-but-topics-remain-hidden/21429) and [here](https://meta.discourse.org/t/groups-link-to-group/58880/3). Other platforms address it with category visibilty settings for

- Public - can see category and topics
- Private - can see category only (including description but not topics)
- Hidden - only group members see category and topics

Adding a Private visibilty setting would help people know a category exists, how to join via category description, etc. Would be nice not to have to use group membership to make categories suddenly appear after joining.

Showing titles of posts but not content would be trickier.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 8, 2017, 6:47am UTC](https://meta.discourse.org/t/view-only-category/60626/6 "2017-04-08T06:47:27Z")

</div>

I still do not get this use case at all, and almost nobody (that can present a rational, coherent story about it to me) is asking for it.

So like.. a porn category, or something? I really do not get this at all and never have.

The cited topics are _incredibly_ weak, @scombs. Not a reflection on you, just that I honestly find the arguments for this “need” to be extraordinarily thin. Color me utterly unconvinced. Where is the killer app here? Heck where is the modestly convincing app?

---

<div class="post-metadata">

### Author: ![scombs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scombs/32/48616_2.png) [@scombs](https://meta.discourse.org/u/scombs)
#### Post date: [April 8, 2017, 7:09am UTC](https://meta.discourse.org/t/view-only-category/60626/7 "2017-04-08T07:09:55Z")

</div>

Ecamples:

- Public category for an organization that have private subcategories for committees.

- Private category like for discussion group/email list.

General public users wont see these categories at at all so site admins have to use things like pinned topics, group page, etc.

Even users who are members of a private category but are not logged in won’t see that category. So users get lost when they come back to the site and can’t find their private category.

It would be nice to have category view and menu options to surface the categories to users with a reminder to login or instructions to join.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [April 8, 2017, 7:22am UTC](https://meta.discourse.org/t/view-only-category/60626/8 "2017-04-08T07:22:15Z")

</div>

I am taking #lounge category as example.

So you like everyone (even guests) to aware of the existence of #lounge category and procedures to join and participate in it by displaying the category name (and pinned topic) in categories list. I am right?

---

<div class="post-metadata">

### Author: ![scombs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scombs/32/48616_2.png) [@scombs](https://meta.discourse.org/u/scombs)
#### Post date: [April 8, 2017, 7:33am UTC](https://meta.discourse.org/t/view-only-category/60626/9 "2017-04-08T07:33:16Z")

</div>

Adfitional live examples

- [https://community.talkbaq.org](https://community.talkbaq.org)

My site has all private categories because the subject matter varies widely. I uses one public category with topics to direct users to the [group](https://community.talkbaq.org/groups) page for sign up.

- [https://se23.life](https://se23.life)

Using groups for topics like Politics that are optin. Users have to find the [group](https://se23.life/groups) page instead of seeing it in a category view or menu.

It’s more of a UX issue. The current options are good. Just trying to solve for new and not logged in users.

Edit: BuddyPress documenation on same features.

- [Group Settings and Roles · BuddyPress Codex](https://codex.buddypress.org/administrator-guide/group-settings-and-roles/)

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [April 8, 2017, 10:19am UTC](https://meta.discourse.org/t/view-only-category/60626/10 "2017-04-08T10:19:46Z")

</div>

I don’t have exact solution for you. But I have good work around. Put the below code in `admin/customize/body` page.

```plaintext
<script>
var TopicTrackingState = require('discourse/models/topic-tracking-state').default;
function addCategories(model) {
    
    var categories = [
            { id: 200, name: "First Private Category", url: "/groups/my-group-page", color: "79a", description_excerpt: "hi, this is description" },
            { id: 201, name: "Second Private Category", url: "/groups/my-group-2", color: "f9a", description_excerpt: "hi, this is description" }
        ];
        
    categories.forEach( function(item, index) {
        item.read_restricted = true;
        item.topicTrackingState = TopicTrackingState.create({});
        
       var category = Discourse.Category.create(item); 
       
        if (!Discourse.Site.currentProp('categoriesById')[category.id]) {
            if (model) {
                model.categories.addObject(category);   
            } else {
                Discourse.Site.currentProp('categories').addObject(category);
            }
        }
    });
    
}
Ember.run.later( function () {
    addCategories(); 
}, 1000);

var DiscoveryCategoriesRoute = require('discourse/routes/discovery-categories').default;
DiscoveryCategoriesRoute.reopen({
    afterModel(model) {
        addCategories(model);
    }
});
</script>

```

In above code you can add all private categories which you want to showcase by putting it in each lines like below

```plaintext
{ id: 200, name: "First Private Category", url: "/groups/my-group-page", color: "79a", description_excerpt: "hi, this is description" },
{ id: 201, name: "Second Private Category", url: "/groups/my-group-2", color: "f9a", description_excerpt: "hi, this is description" }

```

Here `id` must match to the original category id and you should put relevant group’s url in the `url` field.

---

<div class="post-metadata">

### Author: ![Miro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miro/32/66156_2.png) [@Miro](https://meta.discourse.org/u/Miro)
#### Post date: [April 8, 2017, 2:41pm UTC](https://meta.discourse.org/t/view-only-category/60626/11 "2017-04-08T14:41:10Z")

</div>

@Vinoth Kannan

How can I find the category ID?

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [April 8, 2017, 2:44pm UTC](https://meta.discourse.org/t/view-only-category/60626/12 "2017-04-08T14:44:54Z")

</div>

> [@Miro](#):
>
> How can I find the category ID?

Add at the end of your URL `/site.json` (e.g. [https://my.domain/site.json](https://my.domain/site.json)).

Then you need an online tool (try [https://jsonformatter.curiousconcept.com/](https://jsonformatter.curiousconcept.com/)) to read it without going crazy.

---

<div class="post-metadata">

### Author: ![Miro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miro/32/66156_2.png) [@Miro](https://meta.discourse.org/u/Miro)
#### Post date: [April 8, 2017, 3:02pm UTC](https://meta.discourse.org/t/view-only-category/60626/13 "2017-04-08T15:02:37Z")

</div>

> [@Trash](#):
>
> > [@Miro](#):
> >
> > How can I find the category ID?
> 
> Add at the end of your URL `/site.json` (e.g. [https://my.domain/site.json](https://my.domain/site.json)).
> 
> Then you need an online tool (try [https://jsonformatter.curiousconcept.com/](https://jsonformatter.curiousconcept.com/)) to read it without going crazy.

I did read it without getting crazy :-). It lists category but when i click on it get an error.

> Oops! That page doesn’t exist or is private.

Maybe make blocks with information and links as dicourse have here:

[https://meta.discourse.org/c/howto](https://meta.discourse.org/c/howto)

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [April 8, 2017, 3:11pm UTC](https://meta.discourse.org/t/view-only-category/60626/14 "2017-04-08T15:11:57Z")

</div>

> [@Miro](#):
>
> It lists category but when i click on it get an error.
> 
> > Oops! That page doesn’t exist or is private.

You should give existing url (in your case group link is better) in `url` field.

As I told it may not be the exact solution for you.

Edit: Else you can make a custom plugin.

---

<div class="post-metadata">

### Author: ![Miro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miro/32/66156_2.png) [@Miro](https://meta.discourse.org/u/Miro)
#### Post date: [April 8, 2017, 3:51pm UTC](https://meta.discourse.org/t/view-only-category/60626/15 "2017-04-08T15:51:12Z")

</div>

i did add category link, that’s why it says

Oops! That page doesn’t exist or is **private**.

I know only how to install plugins nothing more.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [April 8, 2017, 4:04pm UTC](https://meta.discourse.org/t/view-only-category/60626/16 "2017-04-08T16:04:45Z")

</div>

Above script is working on your Discourse and displaying the link properly. The problem is when you click the link it gives `page doesn’t exist` error. Right?

In this script user can’t view the category actually. That’s why it return the error. So in the `url` field you must give any existing public topic url (or any public url) which is describing about that category.

---

<div class="post-metadata">

### Author: ![Miro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miro/32/66156_2.png) [@Miro](https://meta.discourse.org/u/Miro)
#### Post date: [April 8, 2017, 4:16pm UTC](https://meta.discourse.org/t/view-only-category/60626/17 "2017-04-08T16:16:53Z")

</div>

Ah, Ok.  
That makes it more logical.  
It can go to post where would be description.

Still I will miss the SMF way.

Thanks

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 11, 2017, 11:04pm UTC](https://meta.discourse.org/t/view-only-category/60626/18 "2017-04-11T23:04:29Z")

</div>

> [@Miro](#):
>
> Would it be possible to set category permission so everyone can see the category and introduction post but not the other posts. After reading the intro they can for example subscribe and see the other posts.

Almost. You can create a group that allows people to join of their own accord and set the category so that only group members can join. The won’t be able to read the category introduction, though, so you’d need to create a topic for that somewhere else that describes the category and how to join the group.
