Hoe vervang/overschrijf ik het homepage-sjabloon

AI-generated summary

saish seeks to configure different custom homepages for logged-in and non-logged-in users, preferably without using JavaScript. merefield confirms that a Discourse component is written in JavaScript and suggests checking the custom homepage support for developers. saish tries the method from the GitHub repository but faces issues. merefield advises seeking help in Development or hiring a developer. awesomerobot confirms the method is correct and asks for more details. saish confirms following the steps but still sees the default homepage. awesomerobot asks about console errors. saish reports no errors. merefield suggests changing a setting in preferences. saish resolves the issue by setting the Default Home Page to default and expresses gratitude.

I would like to configure different custom homepages for logged-in and non-logged-in users. While I am aware that this can be implemented using JavaScript, I am interested in knowing whether it can also be achieved through a Discourse component or plugin.

I have come across the component User-specific Discourse home page, which allows creating a new route and adding a template, but I would prefer not to use that approach.

If there are any alternative suggestions or recommended best practices, I would greatly appreciate your guidance.

A discourse component is written in JavaScript :wink:

There is custom home page support for developers and you could differentiate between those types of users.

https://github.com/discourse/discourse/pull/26291

Bedankt voor uw reactie. Ik heb de aanpak geprobeerd die in de GitHub-repository wordt vermeld door \"custom-homepage\": true toe te voegen aan het about.json-bestand van mijn thema, maar het lijkt niet te werken. Kunt u alstublieft bevestigen of dit de juiste methode is?

Ik stel voor om een topic te openen in Dev

Als je worstelt, overweeg dan om een ervaren Discourse-ontwikkelaar in te huren in Marketplace

It’s the correct method, have you followed all of the steps? after adding

  "modifiers": {
    "custom_homepage": "true"
  }

and enabling your theme, do you see this as your homepage?

Ja, ik heb de stappen gevolgd die in de thread werden gegeven. Specifiek heb ik eerst \"custom-homepage\": \"true\" toegevoegd aan de modifiers, en daarna heb ik een component aangemaakt op javascripts/discourse/connectors/custom-homepage/home.gjs.

zie je nog steeds de standaard startpagina? of zie je een lege startpagina? zijn er consolefouten?

Ja, ik zie mijn standaard startpagina en geen fouten in de console

You probably need to change this setting:

image

in preferences

Nu snap ik het, ik moet de standaard startpagina instellen op standaard, dan werkte het.

Bedankt voor uw reactie

Bedankt voor uw reactie, het werkte, ik hoefde alleen de instelling Standaard startpagina in te stellen op standaard.