This seems like ExpressionEngine 101, but I’m stumped… I’ve got a channel that contains library books. On the front-end, these books need to be sorted by title, then by author (since there can be multiple books with the same title). Here’s what I’ve got so far:
{exp:channel:entries channel="books" dynamic="no" disable="categories|member_data|pagination" status="open" sticky="no" orderby="title|book_authors_sorting" sort="asc|asc" search:book_available_in_library="=Yes"}
<a href="http://{url_title_path={segment_1}/{segment_2}/book}"><cite>{book_display_title}</cite></a> by {exp:xhtml:light}{book_authors_sorting}{/exp:xhtml:light}
{/exp:channel:entries}So this should sort the books by title, then by author using the “book_authors_sorting” field (which would typically contain author last names only). However, here’s what that returns for books sharing the same title:
Genesis by Arnold
Genesis by Wenham
Genesis by Hartley
Genesis by Sailhamer
Genesis by Reno
Genesis by Fretheim
Genesis by Brueggemann
Note that the entries are not sorted by last name correctly. If, however, I change the above EE code to something like this:
{exp:channel:entries channel="books" dynamic="no" disable="categories|member_data|pagination" status="open" sticky="no" orderby="book_authors_sorting" sort="asc" search:book_available_in_library="=Yes"}Then it sorts by last name correctly, but obviously, the books are no longer sorted by title alphabetically. Any ideas.
[Mod Edit: Moved to the EE 2 Technical Support forum]