1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

RM 1.1 is it possible to sort category by title ?!

Discussion in 'Resource Manager Support' started by TBDragon, Mar 30, 2014.

  1. TBDragon

    TBDragon Active Member

    hi every one

    is it possible to sort category by title ?!

    if yes then how ?! hope there is way without implementing an addon to do it >_<
     
  2. Mike

    Mike XenForo Developer Staff Member

    It may be possible with a template modification, but alternatively it would require an add-on. It's not a built-in option.
     
  3. TBDragon

    TBDragon Active Member

    thanks @Mike for answering so i need to play in this code ?! or in another one ?!
    HTML:
    <xen:foreach loop="$categories" value="$_category">
                    <li class="{xen:if '{$_category.resource_category_id} == {$selectedCategoryId}', selected}">
                        <a href="{xen:link resources/categories, $_category}" {xen:if $_category.category_description, 'title="{xen:helper striphtml, $_category.category_description}" class="Tooltip" data-tipclass="resourceCategoryTooltip"'}>{$_category.category_title}</a>
                        <span class="count">{xen:number $_category.resource_count}</span>
                    </li>
                </xen:foreach>
    

    thanks again
     
  4. Tracy Perry

    Tracy Perry Well-Known Member

    I can't remember who/where it was (think it was a @Chris D post) that I saw that added a tab to the resource manager to sort by Title.

    In both the resource_category and resource_index templates look for
    Code:
    <ol class="tabs">
                <li class="{xen:if '{$order} == "last_update"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order='}">{xen:phrase latest_updates}</a></li>
                <li class="{xen:if '{$order} == "resource_date"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order=resource_date'}">{xen:phrase newest_resources}</a></li>
                <li class="{xen:if '{$order} == "rating_weighted"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order=rating_weighted'}">{xen:phrase top_resources}</a></li>
                <li class="{xen:if '{$order} == "download_count"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order=download_count'}">{xen:phrase most_downloaded}</a></li>
            </ol>
    and change to
    Code:
    <ol class="tabs">
                <li class="{xen:if '{$order} == "last_update"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order='}">{xen:phrase latest_updates}</a></li>
                <li class="{xen:if '{$order} == "resource_date"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order=resource_date'}">{xen:phrase newest_resources}</a></li>
                <li class="{xen:if '{$order} == "rating_weighted"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order=rating_weighted'}">{xen:phrase top_resources}</a></li>
                <li class="{xen:if '{$order} == "download_count"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order=download_count'}">{xen:phrase most_downloaded}</a></li>
               <li class="{xen:if '{$order} == "title"', active}"><a href="{xen:link resources, '', 'order=title', 'direction=asc', 'type={$typeFilter}'}">{xen:phrase title}</a></li>
            </ol>
    What you end up with is similar to
    screenshot.png
     
    TBDragon likes this.
  5. Chris D

    Chris D XenForo Developer Staff Member

  6. TBDragon

    TBDragon Active Member


    thanks but this is not what i want ^_^

    i want the categories not the resources

    any way i make an addon and @Chris D help me with it , it have some issue but iam ok with that its work anyway ^_^
    i was thinking of giving some time to play with so i can put more options to let the user choose how the order will be if iam done with it i will publish it here ^_^
     
    TSPowerr likes this.
  7. TSPowerr

    TSPowerr Member

    I also look for an option of categories being sortable from A-Z. Can you share your addon with me TBDragon?
     
  8. TBDragon

    TBDragon Active Member

    ok i will add it here

    btw

    the addon have 1 small issue but for me its ok

    the categories in ur ACP will also be sorted from A-Z
     

    Attached Files:

    TSPowerr likes this.
  9. TSPowerr

    TSPowerr Member

    Thanks! Will test it now.

    EDIT: It works, I dont mind ACP problem.
     
  10. TBDragon

    TBDragon Active Member

    and yes i forget to say to stop it just disable the add-on i didnt add an option for it
    as i didnt think some1 will ask for it ^^
     
    TSPowerr likes this.

Share This Page