General discussion
Category and tags under the topic title on the main page

Hi,


I would like to know how to add category and tags under the topic title on the main page as shown in the figure:


5fd3f6b97f3fd


I have edited this section in the file "topics.html":


<div class="codo_topics_topic_name">
<a href="
{{{const "RURI"}}}user/profile/{{{id}}}"><span class="role_styled role_{{{role}}}">{{{name}}}</span></a>
<span><span id="posted_txt">
{{{i18n "posted"}}} </span>{{post_created}}<br />Category: <a href="{{{const "RURI"}}}category/{{{cat_alias}}}">{{{cat_alias}}}</a><br />Tags: </span>
</div>

The variable "cat_alias" works, but when I wanted to use the variable "cat_name", nothing was displayed. I need to display Category name. Same for tags. I would need to see all the tags from the topic if they are presented.


Thank you in advance for the advice


Hi, I would like to know how to add category and tags under the topic title on the main page as shown in the figure: ![5fd3f6b97f3fd](serve/attachment&amp;path=5fd3f6b97f3fd) I have edited this section in the file &quot;topics.html&quot;: ```` &lt;div class=&quot;codo_topics_topic_name&quot;&gt; &lt;a href=&quot;{{{const &quot;RURI&quot;}}}user/profile/{{{id}}}&quot;&gt;&lt;span class=&quot;role_styled role_{{{role}}}&quot;&gt;{{{name}}}&lt;/span&gt;&lt;/a&gt; &lt;span&gt;&lt;span id=&quot;posted_txt&quot;&gt;{{{i18n &quot;posted&quot;}}} &lt;/span&gt;{{post_created}}&lt;br /&gt;Category: &lt;a href=&quot;{{{const &quot;RURI&quot;}}}category/{{{cat_alias}}}&quot;&gt;{{{cat_alias}}}&lt;/a&gt;&lt;br /&gt;Tags: &lt;/span&gt; &lt;/div&gt; ```` The variable &quot;cat_alias&quot; works, but when I wanted to use the variable &quot;cat_name&quot;, nothing was displayed. I need to display Category name. Same for tags. I would need to see all the tags from the topic if they are presented. Thank you in advance for the advice

Hi,


That is because the category name is not being passed to the frontend. Please make the following changes:


Open sys/CODOF/Forum/Topic.php


Around like 177, replace


'u.name as name, u.avatar, c.cat_id, c.cat_img, c.cat_alias, ' .

with


'u.name as name, u.avatar, c.cat_id, c.cat_img, c.cat_alias, c.cat_name, ' .

And, around line 860,


replace


"cat_alias" => $topic ['cat_alias'],

with


"cat_alias" => $topic ['cat_alias'],
"cat_name" => $topic ['cat_name'],

Then, it should work properly.


Hi, That is because the category name is not being passed to the frontend. Please make the following changes: Open sys/CODOF/Forum/Topic.php Around like 177, replace ``` &#039;u.name as name, u.avatar, c.cat_id, c.cat_img, c.cat_alias, &#039; . ``` with ``` &#039;u.name as name, u.avatar, c.cat_id, c.cat_img, c.cat_alias, c.cat_name, &#039; . ``` And, around line 860, replace ``` &quot;cat_alias&quot; =&gt; $topic [&#039;cat_alias&#039;], ``` with ``` &quot;cat_alias&quot; =&gt; $topic [&#039;cat_alias&#039;], &quot;cat_name&quot; =&gt; $topic [&#039;cat_name&#039;], ``` Then, it should work properly.
Necessity is the mother of all inventions!
34
2
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft