דף הבית מותאם קבוצות

Ah! Sorry. I missed that.

Hmm. Yes. I wonder why I removed support for those. I think maybe you can change those in core now?

I’ll see if that’s in core, and if so, remove those settings.

Or maybe something happened in core that broke those changes. I’ll see what I can figure out. . . .

3 לייקים

אני עדיין לא בטוח למה מחקתי תמיכה בדפי הבית המוגדרים כברירת מחדל והאנונימיים מלפני כן. החזרתי אותם.

כעת, אם קיים custom_default_homepage, הוא משתמש בו אלא אם כן יש התאמה לקבוצה תואמת. אם יש anon_page והמשתמש אנונימי, הוא משתמש בו.

לא הצלחתי להבין איך או מתי יש להגדיר את הדף הנייד (האם זה עבור משתמשים אנונימיים? כל המשתמשים? האם הוא עוקף את דף ברירת המחדל? את מפת הקבוצות?), אז מחקתי אותו. אם אתה משתמש בדף הנייד הזה, ספר לי מה אתה חושב שהוא צריך לעקוף (אני חושב שאולי כדאי להגדיר אותו כדף ברירת המחדל אם הם בנייד, אבל אם יש דף קבוצה, אז להשתמש בו? עדיין לא ברור מה לעשות עבור אנונימי מול מחובר–אני מניח שאולי צריך להיות גרסאות ניידות לכולם?).

הנה הקוד:

      let url = null;

      if (settings.custom_default_homepage) {
        url = settings.custom_default_homepage.replace(/^\/+/g, "");
      }

      if (user) {
        if (user.primary_group_name \u0026\u0026 settings.group_page_map) {
          let groupMap = settings.group_page_map.replace(",", ":").split("|");
          const mapEntry = groupMap.find((value) =
u003e
            RegExp(user.primary_group_name).test(value)
          );
          if (mapEntry) {
            url = mapEntry.split(":")[1].replace(/^\/+/g, "");
          }
        }
      } else if (settings.anon_page) {
        url = settings.anon_page.replace(/^\/+/g, "");
      }

ואז זה משנה את דף הבית רק אם ל-url יש ערך.

8 לייקים

האם רכיב העיצוב הזה נועד להפנות כל אחד בקבוצה לדף הבית בכניסה או באמצעות הקישורים? התקנתי אותו, והלוגו מפנה לדף הנבחר אבל בכניסה המשתמש עדיין מופנה לדף ברירת המחדל /latest. אם זה מטפל בהפניית הכניסה הזו, בטח עדיין הגדרתי משהו לא נכון.המטרה שלי היא שכל המשתמשים ייכללו בקבוצת ברירת מחדל וכולם יופנו לדף חלופי בכניסה.

זו צריכה להיות הקבוצה הראשית שלהם כדי שה-TC הזה ייכנס לפעולה. זה מתוכנן כך, כדי שלא תהיה התנגשות כאשר משתמש חבר ביותר מקבוצה אחת עם הפניה מחדש.

2 לייקים

האם רמת אמון 0 נחשבת לקבוצה חוקית? האם זו ההגדרה הנכונה עבור ה-גרופ פייג’ מאפ (Group Page Map)? trust_level_0:/discourse-ai/ai-bot/conversations. זו ההגדרה הנוכחית שהגדרתי.

לא, לא ניתן להשתמש בקבוצות רמת האמון מכיוון שלא ניתן להפוך אותן לראשיות.

ניתן לעקוף זאת באמצעות שימוש בתוסף הקבוצות הדינמיות כדי ליצור קבוצת מראה, אם זה חיוני עבורך.

3 לייקים

האם ניסית להגדיר את דף הבית המותאם אישית לכולם לדף בוט ה-AI שלך, ולאחר מכן להגדיר את דף הבית למשתמשים אנונימיים לעדכונים האחרונים?

לייק 1

Ah. OK. I think a different version of this got sent in my email notification. I like this answer better. :slight_smile:

2 לייקים

ידעתי! עדיין משתמש בהתראות מייל?? זה קצת דינוזאורי, ג’יי!

2 לייקים

By “everyone”, I meant “global”, not the pseudo group. I will edit my post so that it is not misleading.

2 לייקים

I am very old. And besides, I’m logged in to meta for not much more than 10 hours a day, and I don’t want to miss anything!

5 לייקים

First, thank you everyone for jumping in and helping with this! It is greatly appreciated!

This is a head scratcher for me.

I have installed this plugin without any issues and set trust_level_0 in the settings with make this primary group. All members in site were added to the group. All users show this as the primary group now.

In the Custom Homepage for Groups component settings this is what I have set.

When accessing the page the users in the Community-Core primary group still land on /latest. If I change the Anon Page to something other than /latest when logging in the users will be shown whatever page is shown in that field so that is the redirect that is occurring.

I am using the Canvas Screen theme and changed to the default to test with the same result.

I also disabled all theme components and plugins to see if this helped without success.

I am thinking that there is either I am missing something that may be apparent to others or there may be an issue with the component.

Did you look in the inspector and see the primary group in the body tag?

Jay, really not sure what inspector for this is?

The users show in the group and have the same indicator on their profiles as mine in this image.

When you right click on your site and select inspect you can see what pfaffman is asking for.
For example I see this on my user admin page (/admin/users/{user_id}/{username})


And since this is my account when I right click and select inspect I see

There you can see “testgroup” in the <body>

That is what I meant, but I now remember/see that the component gets the primary group from the user model, not from the CSS.

So, maybe find a user in the admin user route, and add .json to the URL. Then check what their primary group is and search (in the browser) for primary_group: true and check that the name matches exactly the case you used in the theme config.

2 לייקים

Hi everyone,

Thanks for the clarification. I followed these instructions and used the .json URL to confirm the exact group name.

The primary group name is indeed Community-Core, with the capital letters and hyphen, which is exactly what I have entered in the theme component’s settings.

Unfortunately, it’s still not working. The Anon page redirect is still in effect. So, the issue must be something else.

Can others confirm this works for them?

Do you have any other ideas what I could check?

לא. אם זה הולך לדף האנונימי ולא ל"דף הבית המוגדר כברירת מחדל", אז זה לא מוצא את המשתמש כאשר זה קורה

      const user = api.getCurrentUser();

אני לא יודע איך זה יכול לקרות אם המשתמש אכן מחובר.

אה, האם ניסית לרענן את הדף?

לייק 1

תודה ג’יי, ניסיתי לטעון מחדש. ניסיתי התאמות רבות לכתובות האתר (URLs) וכדומה. זה בהחלט טוען את דף האנונימי. אם אני משנה את זה, זה עובר לדף הזה וגם מציג /latest בכתובת הדפדפן.

חיפשתי ומניח שאין דרך אחרת פשוטה להפנות מחדש. זה היה קל יותר עם אתרי PHP. אני עדיין מתחיל/ה עם Discourse.

זהו תרחיש קצה מוזר מאוד ונכנס לתחום של לגרום ל-Discourse לעשות משהו שהוא לא נועד לעשות.