ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

sorting entries alphabetically by title

February 13, 2012 4:04pm

Subscribe [5]
  • #1 / Feb 13, 2012 4:04pm

    janitor

    3 posts

    I am working on a website for a medical lab and I have a list of tests that are organized by categories. I’m using the GW Category add on to generate a navigation based on the category structure. My problem is that I cannot seem to sort my list of tests alphabetically by the titles. I’m using the parameter orderby=“title and sort=“asc”. This seems to work on other pages that do not have categories. Any suggestions?

    {exp:gwcode_categories cat_url_title="{segment_4}" entry_count="yes"}
           <a href="http://{path=test_menu/testmenu_category/category}/{cat_url_title}">{cat_name}</a> ({entry_count})
    
    {/exp:gwcode_categories}
        
    {exp:channel:entries channel="test_menu" paginate="bottom" limit="10" orderby=”title” sort="asc"}
     {if no_results}There are currently no tests in this category.{/if}
     <h4><a href="http://{page_url}">{title}</a></h4>
    <p>     {paginate}<br />
          Page {current_page} of {total_pages} pages {pagination_links}<br />
         {/paginate}<br />
    {/exp:channel:entries}

  • #2 / Feb 14, 2012 7:38am

    silenz

    1651 posts

    {exp:channel:entries channel="test_menu" paginate="bottom" limit="10" orderby=”title” sort="asc"}

    The quotes around title do look fishy…

  • #3 / Feb 14, 2012 2:37pm

    Dan Decker

    7338 posts

    Hi janitor,

    Since this is working on the templates where you aren’t using the plugin, the plugin may have something to do with this. If you take the plugin out of the template, are entries ordered properly?

    It may be the forums here messing with things, but also make sure your quote marks around “title” in your orderby= parameter are straight rather than curly.

    What version of ExpressionEngine are you using? Have you checked for any updates to GW Category?

    Cheers,

  • #4 / Feb 14, 2012 3:23pm

    Ian Young

    200 posts

    Have you tried something like: orderby=“title|date”?

    I’d agree, those quotation marks look like they’ve inherited a different character encoding. Probably from a copy/paste or something. Better just to make sure.

  • #5 / Feb 17, 2012 9:12am

    jmulkey

    11 posts

    It was the quotes around “title”! Can’t believe I missed that. Thanks so much for your replies.

  • #6 / Feb 20, 2012 4:32pm

    Shane Eckert

    7174 posts

    Hello jmulkey,

    You are not the first by any means to have pasted in code and gotten some messed up encoding. It happens to the best of us.

    I am glad things are working for you now.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases