그룹용 커스텀 홈페이지

PR welcome. PM me if you have a budget.

2개의 좋아요

Hey Jay, why does this component add ?_discourse_homepage_rewrite=1 to the end of the URL of the page it redirects to?

And also, why does it display a more complex URL (i.e. mysite.com/t/blahblahblah/2343?_discourse_homepage_rewrite=1) instead of simply mysite.com?

1개의 좋아요

I don’t know! I don’t know why that would be happening. No one with a budget has complained, but I’ll try to take a look.

1개의 좋아요

Heads up that this is cAsE sEnSiTiVe for any amateurs (like me) who took it took an hour of testing to figure out why it wasn’t working.

2개의 좋아요

Always copy-paste!

3개의 좋아요

It would be a nice touch to make it case-insensitive. It was a revelation to me when I discovered how to bake case-insensitivity into my Data Explorer queries!!!

2개의 좋아요

I think it should be easy enough to do that, but not something I’m going to fix unless I’m fixing something else.

3개의 좋아요

I think this workaround may be broken now. The homepage to permalink external URL I had on a test site broke a while back at some point. The permalink works, but the homepage feature now goes to the oops page for the group map setting. I haven’t had time to figure out why it broke yet, but presumably a core change somewhere. :thinking:

2개의 좋아요

Hi
I got a issue with opening the full chat screen, when I click the full screen chat button, web crushed.
my setting is like this


I guess the full screen chat url is not compatible with the homepage url

1개의 좋아요

What happens?

1개의 좋아요


like this, the page is not showing at the beginning, after clicks it shows the multiple top bar but nothing else
when I’m not going to full chat screen from the custom homepage, everything is normal

2개의 좋아요

Are we able to add published paged topics as Custom Homepages?

1개의 좋아요

You can try, but I think it should work.

I’ve had trouble lately with this theme component and the admin sidebar that I haven’t had time to debug just yet.

3개의 좋아요

Hello!

First off, let me say thank you so much for this theme component. It’s incredibly helpful, and I wish there was something similar built into Discourse.

I’ve noticed a bug when setting the homepage to a category—if the category is set to “Show subcategory list”, then the subcategory list will not show on the first page load. This issue does not occur if you click the site logo or access the category directly.

Any thoughts on why this might be occurring? I took a look at the source code, but nothing stood out as problematic. I’m guessing it’s some nuance with how those subcategories are rendered.

2개의 좋아요

Hey @Nathanael ! Sorry about that. Yes, I’ve noticed–though I think the problem I noticed had to do with something about the sidebar.

It hasn’t (yet!) bothered me enough to fix it and no one has offered a compelling reason (cash is an obvious one, but there could be others) to fix it. I think you’re the first person to complain, but I might just have forgotten.

If you’ve got cash or something else compelling, my email address is in my user card. :slight_smile:

4개의 좋아요

Hey @nathank

It seems the “custom default homepage” doesn’t work. I tested with /latest?order=created, c/support/5, and some other relative URLs.

Then I checked the code. We haven’t used custom_default_homepage or even anon_page settings anywhere in the code. I used Github search. This is the initializer:

      if (user) {
        if (user.primary_group_name && settings.group_page_map) {
          let groupMap = settings.group_page_map.replace(",", ":").split("|");
          const mapEntry = groupMap.find((value) =>
            RegExp(user.primary_group_name).test(value)
          );
          if (mapEntry) {
            const url = mapEntry.split(":")[1].replace(/^\/+/g, "");
            setDefaultHomepage(url);
            PreloadStore.remove("topic_list");
          }
        }
      }

Did I miss something?

Update: I checked the last commit and the corresponding logic is deleted. Not sure why though.

2개의 좋아요

I really need to get the op to be owned by me, but I’m watching the topic so I guess it doesn’t matter that much.

I’ll try to take a look at this. If you’ve got a budget I might look harder or faster. :wink:

4개의 좋아요

*randomly waves her magic wand

done! :woman_mage:

I’m sure Nathan won’t mind :wink:

5개의 좋아요

~~It’s working for me, and I just upgraded. ~~ EDIT: OOOps. I didn’t test anything but the group mappings!

What settings did you use for Group page map?

Is it something like this? todo-users:/c/projects/19?

Also, in this example, it works only for users that have todo-users as their primary group.

4개의 좋아요

The group map works fine for me, but the other settings seem to be broken.
For example this doesn’t work for me:

As @mrmowji said, those settings are no longer referenced in the code but still part of settings.yml.

3개의 좋아요