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

how to sort threads alphabetically ?

Discussion in 'XenForo Questions and Support' started by erich37, Dec 22, 2010.

  1. erich37

    erich37 Well-Known Member

    I am wondering if there is a possibility to sort Threads (in a certain Forum) alphabetically ?

    Many thanks,
     
    anotheralias likes this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Click on Thread Display Options at the bottom of the thread list.


    sort.png
     
    anotheralias likes this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  4. Brogan

    Brogan XenForo Moderator Staff Member

    anotheralias likes this.
  5. erich37

    erich37 Well-Known Member

    I mean sorting it permanently as Admin, as I want to create a few hundred threads, I would like to sort them somehow, either alphabetically or somehow else....
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The link I posted should do that for you.
     
  7. erich37

    erich37 Well-Known Member

    Hi Jake,

    not sure what is the code to have all threads in a specific forum sorted ALPHABETICALLY in ascending order ?

    I also think this should be an option as per XF-default.....probably a suggestion for Kier & Mike....
     
    Garamond likes this.
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> node_forum_level_2

    Replace this code:

    Code:
    			<h3 class="nodeTitle"><a href="{xen:link forums, $forum}" data-description="{xen:if @nodeListDescriptionTooltips, '#nodeDescription-{$forum.node_id}'}">{$forum.title}</a></h3>
    
    ...with this:

    Code:
    			<xen:if is="{$forum.node_id} == 2">
    				<h3 class="nodeTitle"><a href="{xen:link forums, $forum, 'order=title', 'direction=asc'}" data-description="{xen:if @nodeListDescriptionTooltips, '#nodeDescription-{$forum.node_id}'}">{$forum.title}</a></h3>
    			<xen:else />
    				<h3 class="nodeTitle"><a href="{xen:link forums, $forum}" data-description="{xen:if @nodeListDescriptionTooltips, '#nodeDescription-{$forum.node_id}'}">{$forum.title}</a></h3>
    			</xen:if>
    
    Change the number 2 to the node_id of the specific forum you want to sort.

    This works by changing the link for the specified forum to include the sort parameters. It isn't a proper default option like you want, but it should work for your purposes.
     
    erich37 and anotheralias like this.
  9. Saeed

    Saeed Well-Known Member

    Thank you for posting this, Jake. I want to do exactly the same, i.e. in the view listing all threads in a particular forum, I would like the threads to be listed alphabetically by thread title.

    However, this code doesn't seem to work. I have made sure that I changed the node_id to the desired forum, but with no effect. Has the code changed since last posted perhaps? :)
     
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The link should contain "order=title" after editing that template. If it doesn't then be sure you are clicking the forum's link in the node listing as that is the only place where that parameter will be included.
     
  11. gldtn

    gldtn Well-Known Member

    So, if we go directly to the node link without clicking on it through the forum list it won't be ordered correct?

    how would I do the same within a page?
     
  12. ragtek

    ragtek Guest

Share This Page