I’m still not sure why I deleted support for the default and anon homepages before. I put those back.
Now if there is a custom_default_homepage it uses that unless there is a matching group match. If there’s an anon_page and the user is anonymous, it uses that.
I couldn’t figure out how or when the mobile page should be set (is it for anon users? all users? does it override the default page? the group map?), so I deleted it. If you’re using that mobile page, tell me what you think it should override (I think maybe set it as the default page if they are on mobile, but if there is a group page, then use that? Still not clear what to do for anon vs logged in–I guess there maybe needs to be mobile versions for all of them?).
Here’s the code:
let url = null;
if (settings.custom_default_homepage) {
url = settings.custom_default_homepage.replace(/^\/+/g, "");
}
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) {
url = mapEntry.split(":")[1].replace(/^\/+/g, "");
}
}
} else if (settings.anon_page) {
url = settings.anon_page.replace(/^\/+/g, "");
}
And then it changes the homepage only if url has a value.
Is dit themaonderdeel bedoeld om iedereen in de groep om te leiden naar de startpagina bij het inloggen of bij het gebruiken van de links? Ik heb het geïnstalleerd en het logo leidt naar de geselecteerde pagina, maar bij het inloggen wordt de gebruiker nog steeds omgeleid naar de standaard /latest pagina. Als dit de inlogomleiding afhandelt, moet ik nog iets verkeerd hebben ingesteld.
Mijn doel is dat alle gebruikers worden opgenomen in een standaardgroep en dat iedereen bij het inloggen wordt omgeleid naar een alternatieve pagina.
It needs to be their Primary group for this TC to kick in. That is by design, so that there is no conflict when a user is a member of more than one group with a redirect.
Our logic at the start was that it only overrides the default homepage - all others (including anon) take precedence.
The classic use case is using the Categories + Latest view on desktop, as this displays as Categories on mobile (which isn’t very useful).
These days, the sidebar makes this unnecessary for most instances, so I think that removing it makes sense. It might catch out some who have been using the TC for a while though.
Wordt niveau 0 van vertrouwen beschouwd als een geldige groep? Zou dit de juiste instelling zijn voor de Groepskaart? trust_level_0:/discourse-ai/ai-bot/conversations. Dat is de huidige instelling die ik heb ingesteld.
Heb je geprobeerd om de aangepaste standaard startpagina in te stellen op je AI-botpagina (zodat het de standaard is voor iedereen) en vervolgens de startpagina voor anonieme gebruikers in te stellen op ‘nieuwste’ (om de standaard voor hen te overschrijven)?
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.
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})
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.
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.
Nee. Als het naar de anon-pagina gaat en niet naar de “aangepaste standaard startpagina”, dan vindt het de gebruiker niet wanneer het dat doet
const user = api.getCurrentUser();
Ik weet niet hoe dat kan gebeuren als de gebruiker daadwerkelijk is ingelogd.
Ah, het stelt de gebruiker in de initializer in, dus ik denk dat als je inlogt nadat de site is geladen, deze code mogelijk niet opnieuw wordt uitgevoerd. Heb je geprobeerd de pagina opnieuw te laden?
Bedankt Jay, ik heb geprobeerd opnieuw te laden. Ik heb talloze aanpassingen geprobeerd aan de URL’s en dergelijke. Het laadt zeker de Anon-pagina. Als ik dat verander, gaat het naar die pagina en toont het ook /latest in de browser-URL.
Ik heb gezocht en ga ervan uit dat er geen andere manier is om simpelweg door te verwijzen. Het was gemakkelijker met PHP-sites. Ik ben nog steeds een beginner met Discourse.