In featured topic no tags and categories defined

Hi! It seems I’ve found a problem with the object which comes to the FeaturedTopic object if option “show categories and featured topics” is enabled. When I want to get {{topic.tags}} in featured-topic.hbs it returns undefined, whenever when I do this in single topic, the array is present. Can you check this?

1 Like

Hi @misham ,
It doesn’t sound like a bug to me. All the Ember Templates might receive different data subject to a lot of different situations. Looks like a reduced form of the topic object might have been passed to the featured-topic.hbs. I took a quick look and featured-topic is en Ember component which appears in the following place in the codebase:

You can use write {{log t}} below the <FeaturedTopic line and see for yourself in the browser’s console, what all keys are available in the topic object t.

Hope this helps.

1 Like

Is there any way to change this? To pass full topic object? When I do log t, there is no tags in object for now

Is there any way to change this? To pass full topic object? When I do log t, there is no tags in object for now

Components get their data from what is passed to them.

There is often a tree of components and you need to trace the path of data back through the hierarchy of components.

At some point this gets to the route model then jumps back to the back end server (and a switch from Ember JavaScript to Rails) and what is serialised to the model in the specific route you are in.

You may need to modify what is serialised by the API in order to add the additional data you need. That would require a plugin as only plugins can modify the API.

Best to review the source code and that of the many available plugins to understand the way in which that is done.

2 Likes

Could you give an example of such plugin please?