Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
Hi again!

Following case: I'm building a bibliography, with an editable_region of "author". As the regions says it's carrying the name of the author of a book. As it's set up now there might be "T.C. Boyle" or "W. Goethe", "J.K. Rowling". When outputting the different variables with cms:pages I would like to be able to order the entries by the authors LAST name (instead of having Rowling showing up first before Boyle and Goethe) - what I could do is to set a up a new region, carrying specifically the author's last name. But I do have already quite a number of entries... (and my lazyness is not the entire point ;) ).

Now, is it possible to order pages only by a part of a custom field's value?

Kjaus, I think you'll have to roll up your sleeves and get ready to create a new region for only the last name :)
Bibliography is a science itself :)
Your question seems to be more profound:
Gilbert, Sandra M., and Susan Gubar.

Thompson, Hunter S.

Edited by Ann Charters.

Stanford, Judith A., ed.

Sometimes first author even gets reversed
Smith, John, Jane Doe, and Bob Anderson.
Its achievable with the <cms:query> tag.

You can split the author custom field into a temporary variable using SELECT SUBSTRING_INDEX(author, ' ', -1) as `lastName` and then ORDER BY `lastName`, author

This requires a knowledge of MYSQL and is a long way around to just creating a new editable region.
@KK: I feared as much ;)

@Keakie: That sounds intriguing, but MYSQL is definitely beyond me ;)
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
6 posts Page 1 of 1

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 4 guests