By Vincent Robert on Wednesday, 01 August 2018
Posted in General Issues
Likes 0
Views 620
Votes 0
Hello,
I have a child container of a forum category that I want hidden by default - but not the rest of my categories in category view. How can I achieve this please?
Hey there,

If I understand your question correctly, is it you want to hide Event's child category only? If yes, I am sorry to tell that it is impossible to hide a certain sub category in backend setting currently.

If you want to hide all the sub categories at the first view, you can download my attached file, default.php and paste it to the override location (JoomlaFolder/templates/YourCurrentTemplate/html/com_easydiscuss/categories/default.php) and check it out.
·
Wednesday, 01 August 2018 12:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi, thanks for that. So, I definitely do not want to hide all my sub categories - but only certain ones. So, I guess what you made for me will not work either.
·
Wednesday, 01 August 2018 20:31
·
0 Likes
·
0 Votes
·
0 Comments
·
That file would'nt not work on hiding selective child categories. But if you know the parent category id, you can exclude the childs from being generated,

Example:

(Original code)

[gist]
<h2 class="ed-page-title"><?php echo JText::_('COM_EASYDISCUSS_CATEGORIES'); ?></h2>

<div class="ed-categories">
<div class="ed-list">
<?php if ($categories) { ?>
<?php foreach ($categories as $category) { ?>
<div class="ed-cat-panel">
<div class="ed-cat-panel__hd">
<?php echo $this->output('site/categories/default.item', array('category' => $category)); ?>

<?php if ($category->totalSubcategories && $this->config->get('layout_show_all_subcategories')) { ?>
<a data-ed-toggle="collapse" href="#collapse-cat-<?php echo $category->id; ?>" class="ed-cat-panel__toggle">
<i class="fa fa-chevron-down"></i>
</a>
<?php } ?>
</div>

<?php if ($category->totalSubcategories && $this->config->get('layout_show_all_subcategories')) { ?>
<div class="ed-cat-panel__bd collapse in" id="collapse-cat-<?php echo $category->id; ?>">
<div class="ed-tree">
<?php echo $category->printTrees($category->childs, $category->id); ?>
</div>
</div>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
</div>
</div>

[/gist]


(Modified Code)
[gist]
<h2 class="ed-page-title"><?php echo JText::_('COM_EASYDISCUSS_CATEGORIES'); ?></h2>

<div class="ed-categories">
<div class="ed-list">
<?php if ($categories) { ?>
<?php foreach ($categories as $category) { ?>
<div class="ed-cat-panel">
<div class="ed-cat-panel__hd">
<?php echo $this->output('site/categories/default.item', array('category' => $category)); ?>

<?php if ($category->totalSubcategories && $this->config->get('layout_show_all_subcategories')) { ?>
<a data-ed-toggle="collapse" href="#collapse-cat-<?php echo $category->id; ?>" class="ed-cat-panel__toggle">
<i class="fa fa-chevron-down"></i>
</a>
<?php } ?>
</div>

<?php if ($category->totalSubcategories && $this->config->get('layout_show_all_subcategories')) { ?>
<?php if ($category->id == 10) { continue; } ?>
<div class="ed-cat-panel__bd collapse in" id="collapse-cat-<?php echo $category->id; ?>">
<div class="ed-tree">
<?php echo $category->printTrees($category->childs, $category->id); ?>
</div>
</div>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
</div>
</div>

[/gist]
·
Wednesday, 01 August 2018 23:15
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for that.

I would prefer a feature for this rather than customized code (when EasyDiscuss updates). I believe this is very beneficial. Please close this request.
·
Wednesday, 01 August 2018 23:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

Perhaps it would be best if you can submit a feature request regarding this feature by creating a new ticket on the forums here and set it to "Feature Request" so that everyone else could vote for it. We will prioritize this feature during the development process for the next major version of EasyDiscuss if there are more people request on this.

As a gentle reminder, kindly start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiry. I will lock this thread.
·
Thursday, 02 August 2018 10:16
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post