كيفية استبدال/تجاوز قالب الصفحة الرئيسية

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.

(post deleted by author)

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.

إعجابَين (2)

Thank you for your response. I tried the approach mentioned in the GitHub repository by adding "custom-homepage": true to the about.json file of my theme, but it does not seem to be working. Could you please confirm if this is the correct method?

I suggest opening a topic in Dev

If you are struggling consider hiring a seasoned Discourse developer 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?

Yes, I followed the steps given in thread. Specifically, I first added "custom-homepage": "true" in the modifiers, and then I created a component at javascripts/discourse/connectors/custom-homepage/home.gjs.

do you still see the default homepage? or do you see a blank homepage? are there any console errors?

Yes, I see my default homepage and no errors in console

You probably need to change this setting:

image

in preferences

إعجابَين (2)

Now i got it i have to set Default Home Page to default then it worked

إعجاب واحد (1)

Thank you for your response

إعجاب واحد (1)

Thank You for your response it worked i just needed to set Default Home Page setting to default.

إعجاب واحد (1)