By Mist on Saturday, 08 March 2014
Posted in General Issues
Replies 3
Likes 0
Views 725
Votes 0
I am struggling for some time now to find a bug and can't solve it yet, maybe you can help me out.

I am trying to output the subcategories in a dropdown menu but for some reason only the first subcategory link gets the "li" wrapper

I am outputting the subcategories this way

<ul class="dropdown-menu dropdown-menu-right dropdown-scroll" role="menu">
<li><?php echo $category->nestedLink; ?></li>
</ul>


If i am looking at the generated html output i notice that only the first subcategory is rendered inside that "li" tag, all other ones are rendered outside the tag and the subcat names has some comma appended to them
Let me show you an example of the actual html output containing the bug

<ul role="menu" class="dropdown-menu dropdown-menu-right dropdown-scroll">
<li><a href="/subcategory1_link_here">Sbucategory 1</a></li>
<a href="/subcategory2_link_here">, Subcategory 2</a>
<a href="/subcategory3_link_here">, Subcategory 3</a>
<a href="/subcategory4_link_here">, Subcategory 4</a>
</ul>


As you can notice only the first subcategory gets inside the "li" tag.


So, where i can fix this ?
Where i can control the output for the following code

<?php echo $category->nestedLink; ?>


I think this output is hardcoded somewhere and basically i just want to wrap the links in some "li" tags
Hello Mist,

Try this, edit the file /components/com_easydiscuss/views/categories/view.html.php and at line 187 locate the codes below:


DiscussHelper::accessNestedCategories($category, $nestedLinks, '0', '', 'link', ', ');


Replace it with,


DiscussHelper::accessNestedCategories($category, $nestedLinks, '0', '', 'list', ', ');
·
Saturday, 08 March 2014 13:57
·
0 Likes
·
0 Votes
·
0 Comments
·
This code
DiscussHelper::accessNestedCategories($category, $nestedLinks, '0', '', 'list', ', ');


outputs a hierarchy list

the original code works well as it's outputing the links itself but for some reason they don't get in the li tags as i want them to (only the first link gets right) and there is that comma appended to subcategory name.
·
Saturday, 08 March 2014 21:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mist,

You might want to take a look at the file /components/com_easydiscuss/helpers/helper.php and locate the method accessNestedCategories . You probably want to customize it there.
·
Saturday, 08 March 2014 23:01
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post