Member categories
ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6
Back to this add-on's main page
View Other Add-ons From Yuri Salimovskiy
Order_by Issue in member_categories:categories tag
Bug Report
Tundra
|
Posted: 06 November 2013 12:02 PM |
|
|
|
Hi
I have the following code using member categories to display a nav listing of categories assigned to a member:
<nav class="listing-nav clearfix"> <ul> {exp:member_categories:categories category_group="5" order_by="order"} {if {parent_id} == 0} {if "{segment_3}" == "{category_id}"}<li class="active filter first">{if:else}<li class="filter first">{/if}<a href="{path='investor-login/folder/{category_id}'}">{category_name}</a></li> {if:else} {if "{segment_3}" == "{category_id}"}<li class="active">{if:else}<li>{/if}<a href="{path='investor-login/folder/{category_id}'}">{category_name}</a></li> {/if} {/exp:member_categories:categories} </ul> </nav>
And categories setup like this:
Main Category 1
Sub Category 1
Sub Category 2
Main Category 2
Sub Category 3
Sub Category 4
However, when this out puts in the template the sort order is
Main Category 1
Main Category 2
Sub Category 3
Sub Category 4
Sub Category 1
Sub Category 2
I have used the recommended order_by=“order” parameter, which should honour the sort order of the categories, am I missing something?
I am running EE v.2.6.1
Thanks
Tundra
|
|
|
Yuri Salimovskiy
|
Posted: 07 November 2013 04:31 AM |
# 1
|
|
Developer
|
I think it has something to do with nesting order. Could be a bug, I need to check that. Would you mind posting the screenshot of your categories page in CP?
|
|
|
Tundra
|
Posted: 07 November 2013 05:31 AM |
# 2
|
|
|
Tried to attach a file, but too big for this system (come on Devot-ee!!)
Is there an email address I can send it to?
|
|
|
Tundra
|
Posted: 07 November 2013 05:44 AM |
# 3
|
|
|
I’ve also spotted these errors in the developer log, see attached.
|
|
|
Yuri Salimovskiy
|
Posted: 08 November 2013 02:41 AM |
# 4
|
|
Developer
|
Please email support@intoeetive.com
|
|
|
Mike Mella
|
Posted: 27 March 2017 12:23 PM |
# 5
|
|
|
I have a similar issue. I want to order my categories alphabetically, regardless of their place in the nesting. Is this possible?
|
|
|
Yuri Salimovskiy
|
Posted: 27 March 2017 01:29 PM |
# 6
|
|
Developer
|
On front-end, if you omit order_by parameter, the categories will be sorted alphabetically. On backend, the categories are always displayed nested
|
|
|
Mike Mella
|
Posted: 27 March 2017 02:42 PM |
# 7
|
|
|
Hmm. Doesn’t seem that way for me.
Attached is a shot of my categories, as well as their display on the front-end. Shouldn’t “Embedding a CSI Practice” come before “Prepare for Organizational Change”?
Here’s my code:
{exp:member_categories:categories category_group="{pr-smart-kits-category-group}" errors="off"} {if count == '1'} <h2 class="section-header align-left">Smart Kits</h2> {/if} <a href="{path={pr-smart-kits-template-group}/category/{category_url_title}}" class="tile-parent tile"> <div class="tile-text">{category_name}</div> </a> {/exp:member_categories:categories}
|
|
|
Yuri Salimovskiy
|
Posted: 28 March 2017 04:32 AM |
# 8
|
|
Developer
|
Ah, I see what you mean. The categories are being sorted by name WITHIN their parent.
I added new sort_by_tree=“no” config param - if specified, sorting will not respect category group and parents and will just sort by name or other param you specify.
Please update your files
|
|
|
Mike Mella
|
Posted: 28 March 2017 09:59 AM |
# 9
|
|
|
Thanks for this, Yuri. I’ll have my client re-download it and send it to me.
|
|
|