Alphabetize a List Using orderby=

1.7k views Asked by At

I have a script that searches post titles and generates a list based on a specific label (Freebies). However, it does not return an alphabetical list because of the command "orderby=published" How can I get my list to be alphabetical? I've tried "&Order=alphabet" Can someone tell me what keywords "orderby=" uses? This will be used on Blogger and I am a neophyte :(

Here is the script:

<script type="text/javascript">
var numposts = 100;
var standardstyling = true;

function showrecentposts(json) {
  for (var i = 0; i < numposts; i++) {
    var entry = json.feed.entry[i];
    var posttitle = entry.title.$t;
    var posturl;
    if (i == json.feed.entry.length) break;
    for (var k = 0; k < entry.link.length; k++) {
      if (entry.link[k].rel == 'alternate') {
        posturl = entry.link[k].href;
        break;
      }}
    posttitle = posttitle.link(posturl);
    if (standardstyling) document.write('<li>');
    document.write(posttitle);}
    if (standardstyling) document.write('</li>');
}
</script>
<ul>
<script src="http://blogname.blogspot.com/feeds/posts/default/-/Freebies?       
orderby=published&amp;alt=json-in-script&amp;callback=showrecentposts&amp;max-    
results=999"></script>
</ul>
1

There are 1 answers

0
NiKiZe On

The only two parameters supported for the orderby options is published and updated

This is based on https://developers.google.com/blogger/docs/2.0/reference

A search for "blogger orderby title" gives a few different results some that orderby=title should work, but it depends on what the blog system supports. blogspot.com returns 400 when orderby title is used.

You will have to do sorting on the client side-