Hello everyone,
I am doing a theme to customise several aspects from the default Discourse, with that in mind, one of the things I need to customise is the topic-list-item
which seems to be fairly simple, I add on my theme a file under the path of javascripts/discourse/templates/components/topic-list-item.hbs
and I can put my code there. Nevertheless, here is where the questions start to emerge.
There is a method on the component for that template called renderTopicListItem
which is the one that set a property topicListItemContents
which is the one rendered by default. Check:
The first question is WHY? Why we need to do that? Why not just to have the handlebars code as usual?
In order to not interfere too much with the core code I decide to let topic-list-item
like that and replace the topic-list-item.raw.hbs
in my theme and that works without problem.
Nevertheless, I expect that adding a file like javascripts/discourse/templates/mobile/list/topic-list-item.raw.hbs
in my theme will replace the mobile view but it doesn’t.
The method findRawTemplate
still returning the default mobile template from discourse which contains:
Even by doing manual edition within my local Discourse project I am not able to get the mobile version to update with the changes.
Hopefully makes sense the explanation and someone has any knowledge about it, it looks really broken by now and maybe we want to fix it IF it is really broken (I can do so if I understand a bit more what’s going on)
Mean time I will continue looking for an answer myself and update any news. Below a small gif of what I have in my local.
http://g.recordit.co/AtOJlltJ8o
UPDATE: I have also update the raw
to be .hbr
as a recent commit changes the files but still not able to make it work.