That is a very helpful component! Should be from user experience point of view built into Discourse, but that is my opinion.
Anyways, Iām stuck in trying to make the same logic work for Categories. I wanted to do it with api.modifyClass but seem to miss the crucial part. Can you please help me?
I have this setting for my desktop page:
Basically the red box on the left should be clickable:
If you want to experiment and fork this component, you are welcome to do so
As a starting point to get a category to be clickable, I would suggest looking through the code in this component that does so by modifying the topic-list-item component inside Discourse core.
You could try creating a new file within this same folder which targets one of the many types of category layouts included in our components, making sure to target the same category page style you have selected on your forum.
Some of these are listed in their locations belowā¦
We relied on this component to make Categories + Latest view (default in our case) topic cards clickable. Since todayās update to the latest 3.1.0beta8 (now it shows as 3.2.0.beta1-dev), the component stopped working correctly.
Now the active state of the cursor remains as clickable, but topic area is not clickable. With browserās console opened thereās an error, which may help developers to identify the problem:
Uncaught TypeError: this.router is undefined
function navigateToTopic(topic, href) {
if (this.siteSettings.page_loading_indicator !== "slider") {
// With the slider, it feels nicer for the header to update once the rest of the topic content loads,
// so skip setting it early.
this.appEvents.trigger("header:update-topic", topic);
}
this.session.set("lastTopicIdViewed", {
topicId: topic.id,
historyUuid: this.router.location.getState?.().uuid
});
_url.default.routeTo(href || topic.get("url"));
return false;
}
Hi @kinetiksoft - I havenāt been able to reproduce the problem on my end. The theme component seems to work well against the latest version of Discourse. Using the āpreview on theme creatorā link in the OP here seems to work as well.
Could you share a link to a site with the problem? Perhaps there is clash with another theme/plugin.
Thanks @kinetiksoft! Looks like the problem happens when the theme component is used alongside the ācategories + latestā view (which you have configured as your homepage).
Iāve made a PR which should solve the problem.
Iāll post here once itās merged, and then youāll need to update your forum to the latest version of Discourse core.
Iām not sure if I have something wrong in my set up of this theme component, but all of the body text on the topic on the card is not clickable. If you click just after the text ends on either line, you can activate the card and open the topic.