Moved posts to https://community.nodebb.org/topic/9507/nodebb-plugin-featured-topics-extended-feature-topics-in-a-news-blog-page-and-widgets
print category name inside topic page
-
Is there a way to render the category of a post in a topic page ? something like this work inside recent page :
<a href="{config.relative_path}/category/{topics.category.slug}"> {topics.category.name}</a>
is there anything similiar where I can add inside post.tpl ?
am trying to avoide using js for this. -
Yes, inside post.tpl (which is just a partial that is included into topic.tpl) you can use all the variables from
/api/topic/1
endpoint.So it would look like
<a href="{config.relative_path}/category/{category.slug}"> {category.name}</a>
Hope that helps.
-
@baris it works! thanks a lot!