Using the new custom-homepage feature

In the first post there’s a link to Github with comments explaining the feature. I believe this is still an experimental feature and to try it out you need to use and Install the Discourse Theme CLI console app to help you build themes.

1 Like

thanks for reply manuel, i am already using the cli , git documents show how to add the custom html not actual component , i want to add the serach banner which is already installed on forum , can i call it in home.hbs or i have to create a new html search banner to use

How about showing it on the homepage then?

1 Like

yes this is the issue , i need to add it on homepage , i have added one custom now i have 2 let me remove one from theme thanks agains , much appreciate

1 Like

As mentioned when there’s multiple iterations it works on the subsequent ones and only the first time the filter is not applied. So it would work when I add an initial dry run to the store:

I don’t know how to properly debug this, but maybe it helps to narrow down the issue.

3 Likes

Sounds like a cache that needs warming.

2 Likes

Yeah it has to do with how we preload data. I have a PR ready with a potential fix: DEV: Extract theme resolution to a helper by pmusaraj · Pull Request #27426 · discourse/discourse · GitHub

Will merge early next week.

5 Likes

The PR above has now been merged @nolo, it should fix the issue for you. Thanks again for the report!

2 Likes

I noticed today that adding a component into a route via the new recommended method does not work when using this theme modifier.

import { apiInitializer } from "discourse/lib/api";
import welcomeBanner from "../components/welcome-banner";

export default apiInitializer("1.8.0", (api) => {
  api.renderInOutlet("custom-homepage", welcomeBanner);
});

The only way it works is javascripts/connectors/custom-homepage/welcome-banner.hbs

4 Likes

Seems to work for me… Do you already render another component? I think there was the issue that it only works with one. Or it’s because I’m only using it on stable right now.

3 Likes

I’ll have to test out some more, I am not sure why this isn’t working for me atm.

2 Likes