그룹용 커스텀 홈페이지

개요

이 테마 컴포넌트를 설치하여 활성 테마에 추가하면 '홈페이지’를 제어할 수 있습니다. 이를 통해 디스코스가 기본적으로 허용하는 페이지 세트와 다른 홈페이를 설정하거나, 서로 다른 그룹이 각기 다른 "홈페이지"를 가질 수 있도록 할 수 있습니다(예: 그룹 구성원이 특정 카테고리에만 관심이 있거나 주로 해당 카테고리를 사용하는 경우). 이는 모든 사용자, 익명 사용자(로그인하지 않은 사용자), 모바일 사용자, 또는 사용자의 기본 그룹에 따라 적용될 수 있습니다. @pfaffman이 최초 개발했습니다. User-specific Discourse home page 를 참고하세요.

사용 사례:

  1. ‘일반적인’ 홈페이지가 아닌 다른 것을 원할 때
  2. 익명 사용자를 위한 다른 홈페이지를 원할 때
  3. 모바일 사용자를 위한 다른 홈페이지를 원할 때
  4. 인스턴스의 일부 기능에만 관심이 있는 사용자 그룹이 있을 때. 그들은 자신의 특정 카테고리만 보고 싶어 합니다.
  5. 사용자 그룹을 임시로 특별 이벤트 등으로 리디렉션할 때
  6. 서로 다른 그룹을 위한 다른 랜딩 페이지를 설정할 때

설정

사용자 지정 기본 홈페이지

전체 사용자 지정 홈페이지를 설정할 수 있습니다.

익명 페이지

사이트에 로그인하지 않은 사용자를 위해 지정된 페이지를 사용하도록 설정할 수 있습니다. 위의 전역 설정을 우선하여 적용됩니다.

모바일 홈페이지

Force Mobile Homepage 와 마찬가지로, 모바일 사용자를 위한 다른 홈페이지를 설정할 수 있습니다. 이는 위에서 선택한 옵션들을 우선하여 적용됩니다.

그룹 페이지 맵

여러 항목을 허용합니다. 각 항목은 group_name:path 형식이어야 하며, 여기서 group_name은 그룹 슬러그(그룹 전체 이름이 아님)이고 path는 원하는 홈페이지입니다(예: “/c/great-category/4”).

대상 사용자가 지정된 그룹을 기본 그룹으로 설정했는지 확인하면 됩니다. 테마 설정이나 사용자 기본 그룹이 변경되면 변경 사항을 적용하려면 새로고침이 필요합니다.

:warning: 기본 그룹이 지정된 사용자는 ‘일반적인’ 홈페이지에 접근할 수 없으므로, 이를 가능하게 하는 방법(예: 네이티브 사이드바 기능)이 있는지 확인해야 합니다.

알려진 문제 - 상대 URL만 지원

불행히도 Page Publishing 도 포함되지 않습니다. 그러나 외부 사이트로 리디렉션되는 영구 링크(permalink)를 생성하고 해당 영구 링크를 가리키면 이를 우회할 수 있습니다.

  • @pfaffman은 https://google.com으로 리디렉션되는 /go-google의 영구 링크와 group-name:/go-google와 같은 구성으로 이를 테스트했습니다.
  • 관리 설정의 /admin/customize/permalinks를 통해 영구 링크를 생성할 수 있습니다.
43개의 좋아요
Best way to make the /news directory the home page?
Microcommunities / clubs
Multiple communities on discourse?
How to set the home page to be an AI bot? ex: ask.discourse.com
FKB Pro - Social theme
Filter a single discourse instance by the domain it is accessed by
Default homepage that the user selects
Changing the default homepage to a specific category
Access to particular private categories only
Page for not-logged in users with a single topic displayed
How to redirect when login
How can I make the home page similar to this one?
Show Categories on main page for new visitors and Recent for logged in members
2024: The Year in Review
Can Discourse Support a Shared Forum for Two Websites with Distinct Styling?
Can Unified New dismiss topics after a user scrolls past them?
How to set the home page to be an AI bot? ex: ask.discourse.com
How to set the home page to be an AI bot? ex: ask.discourse.com
How to replace/override homepage template
Change default landing page for Groups (Members → Activity/Messages?)
A new "default homepage" site setting
Can Discourse Support a Shared Forum for Two Websites with Distinct Styling?
Streamlining forum organization with third level sub-categories
Help on redirect user on gated content
Discourse Category Home :house:
Allow invites to direct to a Category
Latest activity list as for replies
Redirect the home page of the forum
Clicking on a category doesn't filter the right topics
Make a category page default (main) page
Change homepage to tag?
Redirect user to specific page after login
Creating sub-communities in a discourse server
Make Chat Tab the default view on Mobile
Homepage plugin for displaying recent topics, latest members, popular threads, and similar elements
Created Topic Sort
Different homepage style for logged in vs logged out users
Force guests to a specific page?

This is a game group changer! :crazy_face:

Good job! Rather powerful TC…

We’ve got a few tweaks at the PR stage, addressing these:

And also adding control of the mobile homepage if you wish it to be different (as per Force Mobile Homepage).

This increases its power significantly, so hope you like it.

6개의 좋아요

Hello!! This is awesome!! :slight_smile:
Thank you very much, this is actually important for my my case (use-case 1).
I have to ask, about " The users with a specified group as primary will not be able to reach your ‘normal’ homepage", what do you mean by “actively provide a way for them to do that” ?
Also, in line with this concept, it will also be useful to show in the homepage a specific order of the categories depending on which group the user belongs to. For example, to show their category at the top, and all the rest below of that. Do you think this is possible? (if not already?).

It means that whatever home page you set in the site settings will be overridden. So if you want users to be able to get there then you’ll need to see that there is a link to get there… Somehow.

I can’t imagine how that would work (maybe I have a bad imagination :man_shrugging:). The use case that I can think of makes users have a different category set as home if the are in a group. Like a car site could let you choose the Ford group as your home page.

If you want different stuff available for different groups then I think you’d do that by having default muted categories.

1개의 좋아요

Hi Jay!
Thank you for your answer :slight_smile:
Lets say I would like to have different categories “pinned” at the top depending to which group a user belongs to. I mean, each different user would see a different “pinned” category. I don’t want to hide the other categories from the user, just make easily visible and readily available the one they will be using the most, right from the homepage (if possible!).
(of course, I’m not “demanding” anything here, just asking if it’s possible with available settings/components)

1개의 좋아요

Hey @lisandro_iaffar

I had a the exact use case which I posted here: Showcased Categories - #18 by jrgong

In my case I set up my advertiser’s client category as homepage with this TC, but they just found it confusing and asked me to remove it again. Hence I think the showcased categories tc with such a modification would be the perfect solution.

3개의 좋아요

Hi @jrgong! :slight_smile:
Thank you very much for pointing me to that topic! And yes! That would be just perfect! I’m moving there to support the idea :muscle:
Thank you again!

I just submitted an update that deals with the new preLoadStore, which was causing it to have the wrong topics displayed on first load.

5개의 좋아요

Hey Jay, I’ve noticed an error after my last Discourse update:

1개의 좋아요

Are you sure that’s the most recent version in github? (Not your fork or a static/local version?) I just ran an upgrade and it’s working. Also looking at the code, there’s only one place where api is used:

        const user = api.getCurrentUser();

and that’s inside a block that definces api.

That is odd. I’ve removed it from that instance anyway as it was surplus. And it seems to be working fine after updating in another instance. Weird. Thanks for taking a look!

Any idea how it interacts with the sidebar? I need to give it a whirl as it looks like the issue of needing a route back to the forum home has been solved by it.

1개의 좋아요

I’ve not tested, but I can’t imagine why not. Please note, I may not have a very good imagination.

1개의 좋아요

I’m testing this now, but have two comments:

  1. The anon path is not working for us - does it require the same format as the group map?
  2. It would be great if there’s a default setting that would just apply to everyone.

1개의 좋아요

Hmm. I thought I’d tested it on the list commit.

Indeed. I guys the people who needed it didn’t need to change to a non-supported home page.

I’ll try to have a look tomorrow though it may be next week.

1개의 좋아요

FWIW It worked for me when I was playing with it yesterday (I had tag/featured/ in there)

It is working fine for me. It only needs the relative path.

But I had the same problem as you until I actually added the component to the Theme! Have you done that?

Yeah, I did think that needed adding. Here 'tis:

https://github.com/pfaffman/discourse-custom-homepage-for-groups/pull/4

2개의 좋아요

Yeah, the same theme works fine when logged in, just not for anon. And just to be sure: the relative URL needs to start with a /? Asking because Jammy used tag/featured/ while I use /c/artwork/8.

I got this to work - it was a mistake on my end.

Perfect, thanks! It’s not showing for me as an update yet though - should it?

1개의 좋아요

It is in my fork. You can install that directly yourself from here if you like until Jay merges it:

https://github.com/nathan-nz/discourse-custom-homepage

Works with or without a /

BTW

The way you have it configured won’t work as users can’t have any of the trust_level groups as their primary group.

Thinking about that - is it added to the default theme for the site (anon uses this)? I’ve been tripped up by adding a component to my ‘dev’ theme but not the default theme.

2개의 좋아요

Yeah I found the mistake - it was related to that :man_facepalming:

2개의 좋아요