Tutorials
Assistance to put the categories list on all pages

Hi,


Thank you for a lovely clean and simple forum.


I am hoping that someone can help me add the categories list onto all the forum pages (specifically topic) as it appears in topics.


60b4b7b95d3c8
60b4b7b95d0e0


Would someone be so kind as to direct me please.


Thank you


Hi, Thank you for a lovely clean and simple forum. I am hoping that someone can help me add the categories list onto all the forum pages (specifically topic) as it appears in topics. ![60b4b7b95d3c8](serve/attachment&path=60b4b7b95d3c8) ![60b4b7b95d0e0](serve/attachment&path=60b4b7b95d0e0) Would someone be so kind as to direct me please. Thank you

Hi mate smile


I think it is necessary to change the "template view" files in the design you are using.


It's best to ask the Codologic team @admin @AdeshRohanD'silva (Adesh Your name cant be mentioned) about this because I'm just not good enough with PHP.

Kind regards and good luck,


Andy smile


Hi mate :) I think it is necessary to change the "template view" files in the design you are using. It's best to ask the Codologic team @admin @AdeshRohanD'silva (**Adesh** Your name cant be mentioned) about this because I'm just not good enough with PHP. Kind regards and good luck, Andy ;)

https://net-twin.de/ Community for creative people - JOIN it Now please
https://github.com/WebCrew My GitHub account
https://sell-co.de/ Lots of Web-Tools and Utilities for free

edited May 31 '21 at 4:58 pm

Hi Andy,


Thanking you for making me feel welcome smile


Yeh, I can change the template, but it is undefined. I am very, very (a couple of days old) in Codoforum and I am just trying to find my way around.


I have found the controllers and the js files (php I am ok, javascript not so but I can follow it).


I am doing something wrong - clearly - but I feel like I am missing something. I also am not sure if I am supposed to be finding a "cleaner" way to create a block or something rather than directly edit files.


I will keep trying and hope that admin / Adesh are kind enough to assist.


Thanks again,


UPDATE:
controller/forum.php - found it !


Again, thank you Andy for the moral support smile


I don't know if this helps, but in case anyone else is looking to do something like this - all corrections welcome - here is what I did.


sys/Controller/Ajax/forum/forum.php
after


$this->assign_admin_vars($tuid);

add


//START ADD CATEGORIES

//get complete list of topics
$new_topics = array();
if (\CODOF\User\CurrentUser\CurrentUser::loggedIn()) {
$tracker = new \CODOF\Forum\Tracker($this->db);
$new_topics = $tracker->get_new_topic_counts();
}
$this->smarty->assign('new_topics', $new_topics);
//$cat->update_count($cats);

if (Util::get_opt('forum_type') === 'classic') {
$raw_cats = $cat->getCategoriesForClassicView($new_topics);
$cats = $cat->generateNestedCategories($raw_cats);
} else {
//gets category name and no of topics each hold
$raw_cats = $cat->get_categories();
$api = new Ajax\forum\topics();
$num_topics_page = \CODOF\Util::get_opt('num_posts_all_topics');
$data = $api->get_topics($num_topics_page * ($page - 1), Topic::$FETCH_TYPE_LATEST, !empty($search_data));
$total_topics = $topic->get_total_num_topics();

$this->smarty->assign('load_more_hidden', false);
if ($total_topics < $num_topics_page) {
$this->smarty->assign('load_more_hidden', true);
}

$total_pages = $topic->get_num_pages($total_topics, $num_topics_page);
$this->smarty->assign('topics', \CODOF\HB\Render::tpl('forum/topics', $data));
$this->smarty->assign('total_num_topics', $total_topics);
$this->smarty->assign('pagination', $topic->paginate($total_pages, $page, 'topics/', false, $search_data));
$this->smarty->assign('num_posts_per_page', $num_topics_page);
$this->smarty->assign('curr_page', $page);
$this->smarty->assign('total_pages', $total_pages);
$cats = $cat->generate_tree($raw_cats);
}

$this->smarty->assign('cats', $cats);
$this->smarty->assign('subcategory_dropdown', \CODOF\Util::get_opt('subcategory_dropdown'));
$user = \CODOF\User\User::get();
//$this->smarty->assign('can_search', $user->can('use search'));

//END ADD CATEGORIES

sites/assets/js/topic/topic.js
before


CODOF.search_data = JSON.parse(CODOFVAR.search_data);

Add


//START ADD CATEGORIES    

//hide all sub categories of parent categories with show_children 0
$('.codo_category_toggle').parent().parent().find('ul:first').hide();

$('.codo_category_toggle').on('click', function () {

$(this).parent().parent().find('ul:first').slideToggle();
});

CODOF.toggleTopicsAndCategories = function () {

$('.codo_categories').toggle();
};

$('#codo_categories_ul').mouseenter(function () {

CODOF.inside_categories_container = true;
}).mouseleave(function () {

CODOF.inside_categories_container = false;
});

$('.codo_categories_category').on('click', function () {

var href = $(this).find('a').attr('href');
if (href)
window.location.href = $(this).find('a').attr('href');
});

$('#codo_category_all_topics').on('click', function () {

$('#codo_categories_ul').slideToggle(200);
$(this).find('i').toggleClass('icon-arrow-up icon-arrow-down')
//$(this).find('i').toggleClass('fa-caret-up fa-caret-down')
});

CODOF.hook.add('before_req_fetch_topics', function () {
CODOF.req.url = 'Ajax/topics/get_topics';
$.extend(CODOF.req.data, CODOF.search_data);
});


$('#codo_category_select li').on('click', function () {

window.location = codo_defs.url + "category/" + $(this).data('alias');
});
//END ADD CATEGORY

topic.less


.codo_category_toggle {

min-height: 50px;
background: @categoryListHoverBg;
padding: 14px 9px;
margin-left: 12px;
cursor: pointer;

&:hover {

background: @categoryListBg;
}
}

#codo_category_all_topics {
border-bottom: 1px solid #eee;
margin-right: 155px;
margin-left: 75px;
margin-top: 22px;
}


.codo_categories {

//margin-top: 6px;
font-family: @descFontFamily;
position: relative;
//overflow: auto;
background: transparent;


.dropdown-menu {

border-radius: 0;
width: 100%;
padding: 5px 0;
margin: 0;
border-top: 0;

a {

text-shadow: none;
}
}
}



ul {
padding: 0;
list-style-type: none;
margin: 0;
//border: 1px solid @categoryListContainerBorderColor;
//border-bottom: 0;
border-top: 0
}

#codo_categories_ul {

background: @bg;
//padding: 20px 0;
margin-left: 75px;
width: 73%;

.codo_categories_category.col-md-11.col-11 {
padding-left: 60px;
}
.codo_last_level_li .row {

border-bottom: 0 !important;
}

li {

//padding-left: 8px;
position: relative;

.codo_category_title_topics {
padding: 20px 10px 10px 36px;
font-weight: bold;
}
}

li {

//border-top: 1px solid @borderColor;
padding: 10px 0;
}

ul {
margin-left: 1em; /* indentation */
position: relative;
border: 0;
ul {

margin-left: 14px;
}
&:before {
content: "";
display: block;
width: 0;
position: absolute;
top: 0;
bottom: 0;
left: 0;
//border-left:1px dotted;
}

li {

&:before {
content: "";
display: block;
width: 10px; /* same with indentation */
height: 0;
//border-top:1px dotted;
margin-top: -1px; /* border top width */
position: absolute;
top: 22px; /* (line-height/2) */
left: 0;
}

&:last-child:before {
background: @bg; /* same with body background */
height: auto;
top: 22px; /* (line-height/2) */
bottom: 0;
}
}

}
}



.codo_new_topics_count {

float: right;
margin-top: 10px;
position: relative;
margin-right: 8px;
min-width: 19px;
text-align: center;
color: @categoryListNewTopicsColor;
padding: 3px;
background: @categoryListNewTopicsBg;
box-shadow: @categoryListNewTopicsBoxShadow;
border-radius: 10px;
line-height: 12px;
display: none;
}

.codo_category_img {

padding: 0;
text-align: center;
//min-height: 50px;
cursor: pointer;
max-width: 50px;
display: none;

img {

width: 100%;
//width: 36px;
//height: 36px;
//margin-top: 6px;
}
}

.codo_categories_category {

// text-shadow: @categoryListTextShadow;
cursor: pointer;
position: relative;

//padding: 0px;
//padding-right: 10px;
//force width for sub topics
//width: 92%;

a {

color: @categoryList_A_Color;
text-decoration: none;
font-size: 13px;
font-weight: bold;
.transition(0.5s all ease-in-out);

&:hover {

color: @categoryList_A_HoverColor;
text-decoration: none;
}
}

> div {
width: 80%;
display: inline-block;
margin-left: 8px;
}

.codo_category_title_header {

//padding: 20px;
//padding-left: 30px;
}

.codo_category_title {

//font-weight: bold;
//font-size: 13px;
margin-top: 5px;
//margin-left: 10px;
//padding-left: 30px;
display: inline-block;
font-family: @titleFontFamily;
float: left;
//width: 86%;
cursor: pointer;

}

.codo_category_title_active {
border-left: 5px solid @startGradient;
line-height: 16px;
}

i {
float: right;
margin-right: 8px;
}

.codo_category_num_topics {

font-family: @numericFontFamily;
font-size: 10px;
float: right;
margin-top: 0px;
position: relative;
margin-right: 4px;
background-color: #cccccc;
width: 32px;
//padding: 6px 0;
text-align: center;
border-radius: 3px;
}
}

> a {

text-decoration: none;

&:hover {

text-decoration: none;
}

}

.active {

background: @categoryListActiveBg;
color: @categoryListActiveColor;
text-shadow: @categoryListActiveTextShadow;
border: 1px solid @borderColor;
border-bottom: 0;

i {

color: @categoryListActiveColor;
}

.codo_category_title {
margin: 0;
width: 40%;
}
.codo_category_num_topics {
margin: 0
}

.codo_mark_all_read {

width: initial;
padding: 5px 6px;
float: right;
position: absolute;
right: 49px;
top: 1px;
}

&:hover {

background: @categoryListActiveHoverBg;
color: @categoryListActiveHoverColor;
}

> .codo_category_content {

color: @categoryListActiveContentColor;
}

}


/* Medium devices (desktops, 992px and up) */
@media only screen and (min-width: @screen-md-min) {

.codo_categories {

padding-left: 8px;
padding-right: 0;
}

}

@media (max-width: 991px) {

}

@media only screen and (max-width: 480px) {

}

@media (max-width: 767px) {
#codo_categories_ul .codo_categories_category.col-md-11.col-11 {
padding-left: 20px;
}
#codo_category_all_topics {
margin-right: 53px;
}
.codo_categories_category.col-xs-11 {
width: 85%;
}
}
/* Screens less than 533px considered mobiles
Make them full width for optimum readability */

@media (max-width: @screen-fw-max) {

}

Add wanted to put it under breadcrumbs and have it closed on entry.
themes/default/template/forum/topic.tpl


<!-- START ADD CATEGORIES -->    
<div class="codo_categories" id="codo_categories_sidebar">
<div class="row codo_categories_line" id="codo_category_all_topics" style="border-bottom:1px solid #eee; left: 0;right:0;">
<div class="codo_categories_category col-xs-11">
<div class="codo_category_title_header">{_t("Categories")}</div>
</div>
<div class="codo_categories_category col-xs-1">
<div class="codo_category_title_header"><i class="icon-arrow-down"></i></div>
</div>
</div>
<ul id="codo_categories_ul" style="display:none;">
<li>
<div class="row">
<div class="codo_categories_category col-md-11 col-11">
<a href="#">
<div style="padding-left: 25px"
class="codo_category_title codo_category_title_active">
{_t("All topics")}</div>
</a>
<span data-toggle="tooltip" data-placement="bottom" title="{_t('No. of topics')}"
class="codo_category_num_topics codo_bs_tooltip">

{$total_num_topics}
</span>
</div>
</div>
</li>
{foreach from=$cats item=cat}
<li>
<div class="row">
<div class="codo_categories_category col-md-11 col-11">
<a href="{$smarty.const.RURI}category/{$cat->cat_alias|escape:url}">
<div class="codo_category_title">{$cat->cat_name}</div>
</a>
<span data-toggle="tooltip" data-placement="bottom"
title="{_t('No. of topics')}"
class="codo_category_num_topics codo_bs_tooltip">

{if $cat->granted eq 1}
{$cat->no_topics|abbrev_no}
{else} -
{/if}
</span>
{*
{if isset($new_topics) && isset($new_topics[$cat->cat_id])}
<a title="{_t('new topics')}"><span class="codo_new_topics_count">{$new_topics[$cat->cat_id]|abbrev_no}</span></a>
{/if}
*}
</div>
{if $cat->show_children eq 0}
<div class="codo_category_toggle col-md-1 col-1"><i
class="icon-arrow-down">
</i></div>
{/if}
</div>
{get_children cat=$cat new_topics=$new_topics}
</li>
{/foreach}
</ul>
</div>
<!-- END ADD CATEGORIES -->

I am sure it is not ideal to edit files, but it was a good way ( for me at least ) to learn the structure.


This is my result.
60b58ef6e9c2f
60b58ef6eb831


Hi Andy, Thanking you for making me feel welcome :) Yeh, I can change the template, but it is undefined. I am very, very (a couple of days old) in Codoforum and I am just trying to find my way around. I have found the controllers and the js files (php I am ok, javascript not so but I can follow it). I am doing something wrong - clearly - but I feel like I am missing something. I also am not sure if I am supposed to be finding a &quot;cleaner&quot; way to create a block or something rather than directly edit files. I will keep trying and hope that admin / Adesh are kind enough to assist. Thanks again, UPDATE: controller/forum.php - found it ! Again, thank you Andy for the moral support 8) I don&#039;t know if this helps, but in case anyone else is looking to do something like this - all corrections welcome - here is what I did. sys/Controller/Ajax/forum/forum.php after ```` $this-&gt;assign_admin_vars($tuid); ```` add ```` //START ADD CATEGORIES //get complete list of topics $new_topics = array(); if (\CODOF\User\CurrentUser\CurrentUser::loggedIn()) { $tracker = new \CODOF\Forum\Tracker($this-&gt;db); $new_topics = $tracker-&gt;get_new_topic_counts(); } $this-&gt;smarty-&gt;assign(&#039;new_topics&#039;, $new_topics); //$cat-&gt;update_count($cats); if (Util::get_opt(&#039;forum_type&#039;) === &#039;classic&#039;) { $raw_cats = $cat-&gt;getCategoriesForClassicView($new_topics); $cats = $cat-&gt;generateNestedCategories($raw_cats); } else { //gets category name and no of topics each hold $raw_cats = $cat-&gt;get_categories(); $api = new Ajax\forum\topics(); $num_topics_page = \CODOF\Util::get_opt(&#039;num_posts_all_topics&#039;); $data = $api-&gt;get_topics($num_topics_page * ($page - 1), Topic::$FETCH_TYPE_LATEST, !empty($search_data)); $total_topics = $topic-&gt;get_total_num_topics(); $this-&gt;smarty-&gt;assign(&#039;load_more_hidden&#039;, false); if ($total_topics &lt; $num_topics_page) { $this-&gt;smarty-&gt;assign(&#039;load_more_hidden&#039;, true); } $total_pages = $topic-&gt;get_num_pages($total_topics, $num_topics_page); $this-&gt;smarty-&gt;assign(&#039;topics&#039;, \CODOF\HB\Render::tpl(&#039;forum/topics&#039;, $data)); $this-&gt;smarty-&gt;assign(&#039;total_num_topics&#039;, $total_topics); $this-&gt;smarty-&gt;assign(&#039;pagination&#039;, $topic-&gt;paginate($total_pages, $page, &#039;topics/&#039;, false, $search_data)); $this-&gt;smarty-&gt;assign(&#039;num_posts_per_page&#039;, $num_topics_page); $this-&gt;smarty-&gt;assign(&#039;curr_page&#039;, $page); $this-&gt;smarty-&gt;assign(&#039;total_pages&#039;, $total_pages); $cats = $cat-&gt;generate_tree($raw_cats); } $this-&gt;smarty-&gt;assign(&#039;cats&#039;, $cats); $this-&gt;smarty-&gt;assign(&#039;subcategory_dropdown&#039;, \CODOF\Util::get_opt(&#039;subcategory_dropdown&#039;)); $user = \CODOF\User\User::get(); //$this-&gt;smarty-&gt;assign(&#039;can_search&#039;, $user-&gt;can(&#039;use search&#039;)); //END ADD CATEGORIES ```` sites/assets/js/topic/topic.js before ```` CODOF.search_data = JSON.parse(CODOFVAR.search_data); ```` Add ```` //START ADD CATEGORIES //hide all sub categories of parent categories with show_children 0 $(&#039;.codo_category_toggle&#039;).parent().parent().find(&#039;ul:first&#039;).hide(); $(&#039;.codo_category_toggle&#039;).on(&#039;click&#039;, function () { $(this).parent().parent().find(&#039;ul:first&#039;).slideToggle(); }); CODOF.toggleTopicsAndCategories = function () { $(&#039;.codo_categories&#039;).toggle(); }; $(&#039;#codo_categories_ul&#039;).mouseenter(function () { CODOF.inside_categories_container = true; }).mouseleave(function () { CODOF.inside_categories_container = false; }); $(&#039;.codo_categories_category&#039;).on(&#039;click&#039;, function () { var href = $(this).find(&#039;a&#039;).attr(&#039;href&#039;); if (href) window.location.href = $(this).find(&#039;a&#039;).attr(&#039;href&#039;); }); $(&#039;#codo_category_all_topics&#039;).on(&#039;click&#039;, function () { $(&#039;#codo_categories_ul&#039;).slideToggle(200); $(this).find(&#039;i&#039;).toggleClass(&#039;icon-arrow-up icon-arrow-down&#039;) //$(this).find(&#039;i&#039;).toggleClass(&#039;fa-caret-up fa-caret-down&#039;) }); CODOF.hook.add(&#039;before_req_fetch_topics&#039;, function () { CODOF.req.url = &#039;Ajax/topics/get_topics&#039;; $.extend(CODOF.req.data, CODOF.search_data); }); $(&#039;#codo_category_select li&#039;).on(&#039;click&#039;, function () { window.location = codo_defs.url + &quot;category/&quot; + $(this).data(&#039;alias&#039;); }); //END ADD CATEGORY ```` topic.less ```` .codo_category_toggle { min-height: 50px; background: @categoryListHoverBg; padding: 14px 9px; margin-left: 12px; cursor: pointer; &amp;:hover { background: @categoryListBg; } } #codo_category_all_topics { border-bottom: 1px solid #eee; margin-right: 155px; margin-left: 75px; margin-top: 22px; } .codo_categories { //margin-top: 6px; font-family: @descFontFamily; position: relative; //overflow: auto; background: transparent; .dropdown-menu { border-radius: 0; width: 100%; padding: 5px 0; margin: 0; border-top: 0; a { text-shadow: none; } } } ul { padding: 0; list-style-type: none; margin: 0; //border: 1px solid @categoryListContainerBorderColor; //border-bottom: 0; border-top: 0 } #codo_categories_ul { background: @bg; //padding: 20px 0; margin-left: 75px; width: 73%; .codo_categories_category.col-md-11.col-11 { padding-left: 60px; } .codo_last_level_li .row { border-bottom: 0 !important; } li { //padding-left: 8px; position: relative; .codo_category_title_topics { padding: 20px 10px 10px 36px; font-weight: bold; } } li { //border-top: 1px solid @borderColor; padding: 10px 0; } ul { margin-left: 1em; /* indentation */ position: relative; border: 0; ul { margin-left: 14px; } &amp;:before { content: &quot;&quot;; display: block; width: 0; position: absolute; top: 0; bottom: 0; left: 0; //border-left:1px dotted; } li { &amp;:before { content: &quot;&quot;; display: block; width: 10px; /* same with indentation */ height: 0; //border-top:1px dotted; margin-top: -1px; /* border top width */ position: absolute; top: 22px; /* (line-height/2) */ left: 0; } &amp;:last-child:before { background: @bg; /* same with body background */ height: auto; top: 22px; /* (line-height/2) */ bottom: 0; } } } } .codo_new_topics_count { float: right; margin-top: 10px; position: relative; margin-right: 8px; min-width: 19px; text-align: center; color: @categoryListNewTopicsColor; padding: 3px; background: @categoryListNewTopicsBg; box-shadow: @categoryListNewTopicsBoxShadow; border-radius: 10px; line-height: 12px; display: none; } .codo_category_img { padding: 0; text-align: center; //min-height: 50px; cursor: pointer; max-width: 50px; display: none; img { width: 100%; //width: 36px; //height: 36px; //margin-top: 6px; } } .codo_categories_category { // text-shadow: @categoryListTextShadow; cursor: pointer; position: relative; //padding: 0px; //padding-right: 10px; //force width for sub topics //width: 92%; a { color: @categoryList_A_Color; text-decoration: none; font-size: 13px; font-weight: bold; .transition(0.5s all ease-in-out); &amp;:hover { color: @categoryList_A_HoverColor; text-decoration: none; } } &gt; div { width: 80%; display: inline-block; margin-left: 8px; } .codo_category_title_header { //padding: 20px; //padding-left: 30px; } .codo_category_title { //font-weight: bold; //font-size: 13px; margin-top: 5px; //margin-left: 10px; //padding-left: 30px; display: inline-block; font-family: @titleFontFamily; float: left; //width: 86%; cursor: pointer; } .codo_category_title_active { border-left: 5px solid @startGradient; line-height: 16px; } i { float: right; margin-right: 8px; } .codo_category_num_topics { font-family: @numericFontFamily; font-size: 10px; float: right; margin-top: 0px; position: relative; margin-right: 4px; background-color: #cccccc; width: 32px; //padding: 6px 0; text-align: center; border-radius: 3px; } } &gt; a { text-decoration: none; &amp;:hover { text-decoration: none; } } .active { background: @categoryListActiveBg; color: @categoryListActiveColor; text-shadow: @categoryListActiveTextShadow; border: 1px solid @borderColor; border-bottom: 0; i { color: @categoryListActiveColor; } .codo_category_title { margin: 0; width: 40%; } .codo_category_num_topics { margin: 0 } .codo_mark_all_read { width: initial; padding: 5px 6px; float: right; position: absolute; right: 49px; top: 1px; } &amp;:hover { background: @categoryListActiveHoverBg; color: @categoryListActiveHoverColor; } &gt; .codo_category_content { color: @categoryListActiveContentColor; } } /* Medium devices (desktops, 992px and up) */ @media only screen and (min-width: @screen-md-min) { .codo_categories { padding-left: 8px; padding-right: 0; } } @media (max-width: 991px) { } @media only screen and (max-width: 480px) { } @media (max-width: 767px) { #codo_categories_ul .codo_categories_category.col-md-11.col-11 { padding-left: 20px; } #codo_category_all_topics { margin-right: 53px; } .codo_categories_category.col-xs-11 { width: 85%; } } /* Screens less than 533px considered mobiles Make them full width for optimum readability */ @media (max-width: @screen-fw-max) { } ```` Add wanted to put it under breadcrumbs and have it closed on entry. themes/default/template/forum/topic.tpl ```` &lt;!-- START ADD CATEGORIES --&gt; &lt;div class=&quot;codo_categories&quot; id=&quot;codo_categories_sidebar&quot;&gt; &lt;div class=&quot;row codo_categories_line&quot; id=&quot;codo_category_all_topics&quot; style=&quot;border-bottom:1px solid #eee; left: 0;right:0;&quot;&gt; &lt;div class=&quot;codo_categories_category col-xs-11&quot;&gt; &lt;div class=&quot;codo_category_title_header&quot;&gt;{_t(&quot;Categories&quot;)}&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;codo_categories_category col-xs-1&quot;&gt; &lt;div class=&quot;codo_category_title_header&quot;&gt;&lt;i class=&quot;icon-arrow-down&quot;&gt;&lt;/i&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;ul id=&quot;codo_categories_ul&quot; style=&quot;display:none;&quot;&gt; &lt;li&gt; &lt;div class=&quot;row&quot;&gt; &lt;div class=&quot;codo_categories_category col-md-11 col-11&quot;&gt; &lt;a href=&quot;#&quot;&gt; &lt;div style=&quot;padding-left: 25px&quot; class=&quot;codo_category_title codo_category_title_active&quot;&gt;{_t(&quot;All topics&quot;)}&lt;/div&gt; &lt;/a&gt; &lt;span data-toggle=&quot;tooltip&quot; data-placement=&quot;bottom&quot; title=&quot;{_t(&#039;No. of topics&#039;)}&quot; class=&quot;codo_category_num_topics codo_bs_tooltip&quot;&gt; {$total_num_topics} &lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/li&gt; {foreach from=$cats item=cat} &lt;li&gt; &lt;div class=&quot;row&quot;&gt; &lt;div class=&quot;codo_categories_category col-md-11 col-11&quot;&gt; &lt;a href=&quot;{$smarty.const.RURI}category/{$cat-&gt;cat_alias|escape:url}&quot;&gt; &lt;div class=&quot;codo_category_title&quot;&gt;{$cat-&gt;cat_name}&lt;/div&gt; &lt;/a&gt; &lt;span data-toggle=&quot;tooltip&quot; data-placement=&quot;bottom&quot; title=&quot;{_t(&#039;No. of topics&#039;)}&quot; class=&quot;codo_category_num_topics codo_bs_tooltip&quot;&gt; {if $cat-&gt;granted eq 1} {$cat-&gt;no_topics|abbrev_no} {else} - {/if} &lt;/span&gt; {* {if isset($new_topics) &amp;&amp; isset($new_topics[$cat-&gt;cat_id])} &lt;a title=&quot;{_t(&#039;new topics&#039;)}&quot;&gt;&lt;span class=&quot;codo_new_topics_count&quot;&gt;{$new_topics[$cat-&gt;cat_id]|abbrev_no}&lt;/span&gt;&lt;/a&gt; {/if} *} &lt;/div&gt; {if $cat-&gt;show_children eq 0} &lt;div class=&quot;codo_category_toggle col-md-1 col-1&quot;&gt;&lt;i class=&quot;icon-arrow-down&quot;&gt;&lt;/i&gt;&lt;/div&gt; {/if} &lt;/div&gt; {get_children cat=$cat new_topics=$new_topics} &lt;/li&gt; {/foreach} &lt;/ul&gt; &lt;/div&gt; &lt;!-- END ADD CATEGORIES --&gt; ```` I am sure it is not ideal to edit files, but it was a good way ( for me at least ) to learn the structure. This is my result. ![60b58ef6e9c2f](serve/attachment&amp;path=60b58ef6e9c2f) ![60b58ef6eb831](serve/attachment&amp;path=60b58ef6eb831)
edited Jun 1 '21 at 2:39 am

Hi mate,


ya it was a great idea to do it that way - thx man smile


I wish you a lot of fun with Codoforum and much success with your community.


Kind regards, Andy smile


Hi mate, ya it was a great idea to do it that way - thx man :) I wish you a lot of fun with Codoforum and much success with your community. Kind regards, Andy :)

https://net-twin.de/ Community for creative people - JOIN it Now please
https://github.com/WebCrew My GitHub account
https://sell-co.de/ Lots of Web-Tools and Utilities for free

111
4
3
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