Friday, 16 October 2015

General: Alphabetical List of Posts


One thing sorely missing from the features of Google's Blogger is an option to list all the posts of a blog in alphabetical order. That's something essential for a film review blog like mine, in which the posts' titles are the names of films. Yesterday my friend Matt coded this solution for me in Javascript. You can see the results by clicking on the link at the top of this page. (The link is only visible if you are reading the blog on a computer).

I've included the code below. If you wish to use it, copy and paste it into the HTML section of a standalone page.

If you use this code, please leave a comment saying thanks and a link to your blog.



Addendum on 8th May, 2016

Important note: The introduction of mandatory HTTPs support has stopped the code working. I have made a correction to make it work again. If you copied the code before today you need to copy it again.



Addendum on 26th November, 2015

Important note: Yesterday Google made a change which stopped the code working. I have made a correction to make it work again. If you copied the code before today you need to copy it again.



<div>
<ul id="postList12"></ul>
</div>
<script type="text/javascript">
var startIndex = 1;
var maxResults = 100;
var allResults = [];
function sendQuery12()
{
   var scpt = document.createElement("script");
   scpt.src = "/feeds/posts/summary?alt=json&callback=processPostList12&start-index=" + startIndex + "&max-results=" + maxResults;
   document.body.appendChild(scpt);
}

function printArrayResults(root)

   //Sort Alphebetically
   allResults.sort(function(a, b){
        var a_string = a.children[0].textContent ;
        var b_string = b.children[0].textContent ;

 if(a_string < b_string) return -1;
 if(a_string > b_string) return 1;
 return 0;
   })

   var elmt = document.getElementById("postList12");
    for (index = 0; index < allResults.length; index++) {
         elmt.appendChild(allResults[index]);
    }
}

function processPostList12(root)
{   
  var elmt = document.getElementById("postList12");
   if (!elmt)
      return;

   var feed = root.feed;

   if (feed.entry.length > 0)
   {
      for (var i = 0; i < feed.entry.length; i++)
      {
         var entry = feed.entry[i];
         var title = entry.title.$t;
         var date = entry.published.$t
  
         for (var j = 0; j < entry.link.length; j++)
         {
            if (entry.link[j].rel == "alternate")
            {
               var url = entry.link[j].href;
               if (url && url.length > 0 && title && title.length > 0)
               {
                  var liE = document.createElement("li");
                  var a1E = document.createElement("a");
                  a1E.href = url;
                  a1E.textContent = title + " (" + date.substr(0,10) + ")";
                  liE.appendChild(a1E);
                  //elmt.appendChild(liE);
                  allResults.push(liE);
               }
               break;
            }
         }
      }
      if (feed.entry.length >= maxResults)
      {
         startIndex += maxResults;
         sendQuery12();
      } else {
         printArrayResults();
      }
   }
}
sendQuery12();
</script>

193 comments:

  1. Thank you so much! It worked! This was really helpful! I will do a little more customization and I guess it will be good to go.

    Thanks again!!!

    ReplyDelete
    Replies
    1. I'm glad you like it. I wish it had been my personal code, but I'm not a web programmer. If you make any interesting customisation, can you share your new code with me, please? It might be something I want to do as well.

      I moved your comment from the place where you originally posted it. Please leave any follow up comments here, rather than on the list itself. Thanks.

      Delete
    2. Hi Mike,

      It's working again with the new code. Thanks a lot.

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. I'm glad you can use it, Alan. This code is supposedly better than the old Yahoo Pipes solution, because the Pipes solution only worked for a maximum of 2000 posts (which I'll probably exceed by early 2017), whereas this solution allows for a theoretically unlimited number of posts.

      Delete
  3. I tried the code. Maybe I am not understanding where to put the code because I can't get it to work. You stated " If you wish to use it, copy and paste it into the HTML section of a standalone page." I am not sure what you mean by "standalone page". I am assuming this is a different page on my website. Is this correct? Thank you!

    ReplyDelete
    Replies
    1. Hi. In your blogger overview page, click on Pages. Then click "New Page". Name the new page somethiing like "Alphabetical List". Click on the HTML tab, copy and paste the code into it. Change in blog name in line 11, publish it, and that's all.

      I see you have a custom domain name. I don't have one myself, so I don't know how the interplay is. Do you still have access to the "normal" blogger layout as well as your custom domain? If so, that's where you have to put the code.

      Delete
    2. The 8th May, 2016 code will also work in a sidebar. In Blogger Layout add an HTML element, and paste in the code. If you have too many to list, go for a stand alone Page as described by Mike.

      Delete
  4. Those who are using my code have probably noticed that it stopped working yesterday. It was necessary to change the value of the variable maxResults from 500 to 150 to fix it. The corrected code is now shown above.

    ReplyDelete
  5. Replies
    1. You're welcome. I'm glad to meet another film blogger, especially someone who loves horror films! It's a pity I don't understand your language. Bosnian?

      Delete
  6. Thank you very much. I thought I'll never get my alphabetical list back when pipes closed. Until now. Code works fine for me! Thanks a lot!

    Regards,
    Sarah

    ReplyDelete
    Replies
    1. I'm glad to be of assistance. I posted the code on October 16th and thought it would work forever, or at least as long as Blogger exists. Then it stopped working six weeks later. Google changed something in the background. It was easy to alter the code so that it worked again. I hope that the new version (posted on November 26th) will work forever. If your page ever stops working, which I hope it won't, come back to my site and check if there are any updates.

      Delete
  7. Hi, can I remove the date ? I want to display the post title only without the post date. Thank you much.

    ReplyDelete
    Replies
    1. There's a line towards the end:
      a1E.textContent = title + " (" + date.substr(0,10) + ")";
      Change this to
      a1E.textContent = title;

      Delete
  8. Wow!! After months of searching I found this post. Thank you so much. This code works like a charm

    ReplyDelete
    Replies
    1. I'm glad you like it, Golu. I still think Google should offer an "official" alphabetical list of posts option.

      Delete
  9. Excellent work. Thanks. This was also a timely effort given the recent demise of the Pipes alphabetical thingy.

    ReplyDelete
    Replies
    1. You're welcome, Nigel. I'm glad this little bit of code can help so many people.

      Delete
  10. Thank yoy very much for your kindness sharing this tip with us. I have been trying to get a solution for ages and I finally did with your help. Thanks a lot xxx

    ReplyDelete
    Replies
    1. You're welcome, Ana. I'm glad the code is so useful to so many people. What sort of blog do you write? As a film blogger an alphabetical list is essential to me, because it's a list of the films I've reviewed.

      Delete
  11. Thanks Jane. I'm glad you like my blog so much. When I started it I only expected it to be read by my friends. For the first 12 months I was only having about 200 pageviews per month, and then it suddenly took off. My record was 11,000 but usually it's about 4000-5000 per month. I just wish that more people would leave comments on my posts. One comment is worth a hundred pageviews to me, because then I know someone has read what I've written and thought about it, rather than just scrolling through and looking at the pics.

    ReplyDelete
  12. Thanks a lot for the solution! it worked great!
    http://ro2morpg.blogspot.ro/
    http://mmorpg2try.blogspot.ro/

    ReplyDelete
  13. no loading page
    http://hentaitk.blogspot.pe/p/lista.html

    ReplyDelete
    Replies
    1. Hyung, it looks like there's a script on your page that redirects the page before it loads. That's what it looks like, at least. You need to check for yourself what is preventing the page loading.

      Delete
  14. Oh Nice Code. Its working great. Thank you very much.

    here is my list......

    http://www.teluguthesis.com/p/blog-page_20.html

    ReplyDelete
  15. Thanks. Had an alphabetic archive that just disappeard. Back in business again thanks to you. http://uddafilm.blogspot.se/

    ReplyDelete
    Replies
    1. I'm glad I could help, Udda. You have an interesting film site. I read a couple of articles with Google's automatic translation service, but the silly translations were too annoying for me to carry on. Congratulations anyway. I love to see people writing about films, especially those that are away from the mainstream.

      Delete
  16. Like you I had previously used Yahoo Pipes, but it stopped working. Today I found the solution through your website, Thanks for sharing!
    Here is my list
    http://www.bhajanlyricsworld.com/p/blog-page_6.html

    ReplyDelete
    Replies
    1. I'm so glad that the code works for you. Please recommend it to your friends. I don't understand why Google doesn't supply this as an inbuilt feature.

      Delete
  17. Hi, is it possible to change the "The"
    Ex: The Allman Brothers Band to, Allman Brothers Band, The?
    Thanks

    ReplyDelete
    Replies
    1. I'm sure it is possible, if you're a programmer. I can't help you, maybe somebody else can.

      Delete
    2. I'm not a programmer.
      If you find someone that knows how to do it please post it. Thanks a lot.

      Delete
  18. When I asked that question I was refering to the Alphabetical Code that is above.

    ReplyDelete
    Replies
    1. Yes, I know what you meant. I can ask about it for you.

      Delete
    2. Here's my blog address http://cs-mm.blogspot.com/

      Delete
  19. Just noticed today that my yahoo pipe code stopped working. Thank you so much for this solution!!

    ReplyDelete
    Replies
    1. Oh, it took you a while to notice! Five months? I use the feature a lot myself on my own blog, almost every day. Whenever I write a new post I check what I've written previously about similar films. The alphabetical list is a lot easier to navigate than the search feature.

      I really hope that someone from Google will find this post. It really ought to be an inbuilt blogger function. If it's advertised on Google's own pages more people would use it. As it is, only relatively few people stumble on this page by accident, and even those who find it might not trust the code. Non-programmers are terrified of viruses and trojans.

      Delete
  20. Hi, the code doesn't work for me anymore, I had to change from 150 to 100, is that happening just for me or everybody?

    ReplyDelete
    Replies
    1. It's still working fine for me with a maxResults value of 150.

      Delete
    2. Hi Mike

      For a while it stopped working for me but I changed back to 150 and now its OK. Thanks

      Delete
  21. Hello! Thanks for this code...but I have a problem: Sometimes the alphabetical post lists disappears from the blog!!! Why? Can you help me?? Thanks...

    ReplyDelete
    Replies
    1. Sorry, I don't understand what you mean.

      Delete
    2. no problem,it seems to work well now...thank you very much :)

      Delete
  22. Hi, mine stopped working since Google had the HTTP to HTTPS update

    ReplyDelete
    Replies
    1. I've received messages about the HTTPS update, but it hasn't been implemented for my blog yet. If I manually turn on the HTTPS the code doesn't work. I'll have to try to get more information about it.

      Delete
    2. Hi Mike,

      I really like this search it was working fine on Dynamic Views until they change the HTTP to HTTPs. If you could fix this would be great. Thanks a lot.

      Delete
    3. I've made a change to the code today. It should work. Please try it and let me know if it works.

      Delete
    4. Hi Mike,

      The new code is working. Thanks a lot

      Delete
    5. The new code is working fine it takes between 5-15 seconds other times longer but opens my 5000+ posts. Thanks again

      Delete
    6. The list was faster when it was possible to read chunks of 500 at a time. Having to decrease the chunk size (maxresults) to 150 halved the speed (for my blog anyway).

      I use your blog as a stress test for my code. As far as I know, no other blog that uses my code has more posts.

      Delete
  23. Oh no!! Sorry but it happened again!! The code doesnt work always, that what I meant...if you go to my website http://thomaspynchonslibbr.blogspot.it/
    there is on the left "post in ord. alfabetico" (posts in alphabetical order); when I copy and paste the code it works but, after hours or days the alphabetical list disappears...why? could you help me? thanks

    ReplyDelete
    Replies
    1. I'm not sure what you're trying to do, Thomas, but it isn't right. The words "post in ord. alfabetico" aren't a link. If you look at my blog in comparison, the words "For a list of all posts in alphabetical order click here" are a link to the page http://dansator.blogspot.com/p/alphabetical-list.html

      You need to copy and paste the code unto a standalone page, and offer visitors a link to that page.

      Delete
    2. ah, my fault!! I inserted the code in a widget html!! Now I have inserted the code in a page html and it works now!!
      thanks a lot mister Hood

      Delete
    3. You're welcome, Thomas. Today I made a small change to the code to make it work on blogs with mandatory HTTPs support. So far this only effects American blogs (blogspot.com) but it will probably be extended to other countries (such as blogspot.it) in the near future.

      Delete
  24. I was informed that the code no longer worked for blogs with mandatory HTTPs support (which hasn't yet been rolled out for all countries). I have made a small change in line 11 of the code to fix the problem. If your list no longer works, please copy the new version of the code.

    ReplyDelete
    Replies
    1. Hi I tried your list yesterday cause we ran into same problem and it stopped working. We ran into the problem over last few days when our list stopped working. Its kind of a big problem since its a large list and a relatively popular site for video game mods.

      Delete
    2. New code does work but it sometimes loads. sometimes doesnt.

      Delete
    3. I don't understand why the code should sometimes work for you. It should either always work or never work. What's your blog address, so I can check it out for myself? How large is your list? My blog has 2025 posts, and I write new posts almost every day. Do you have more posts?

      Delete
  25. I'm sorry, Thomas, I can't help you with this. I do have some knowledge of HTML, but I don't consider myself an expert. I suggest you post your question in the Google forums, the Blogger section. I've posted questions in the past and always received good advice. The address is http://productforums.google.com

    ReplyDelete
  26. Is there an easy way to remove the breaks between titles in the list?

    ReplyDelete
    Replies
    1. When I used the code there was an extra line break between each item.
      Apple

      Banana

      Cherry

      like that. Is there a way to remove the extra breaks between the lines so it looks like this:
      Apple
      Banana
      Cherry

      Delete
    2. There are no extra line breaks when I use the code. What browser are you using? It looks fine for me with Google Chrome and Internet Explorer.

      Delete
  27. Thanks buddy, after yahoo pipes broke my functionality (which I guess has been dead for awhile) your solution works beautifully, hopefully google doesn't keep messing with it

    ReplyDelete
  28. Thanks so much for sharing this code! It is exactly what I was looking for!

    ReplyDelete
  29. Hello. It is possible to have this "List of Posts", list the post by date, with the date appear like date/month/year ?

    ReplyDelete
    Replies
    1. I only have very primitive knowledge of Javascript, so I can't give you a solution. You might have a friend who can help you. All I can say is that the main logic in the code is the alphabetic sorting. If you don't sort the list it's in reverse chronological order, the newest posts first.

      Delete
    2. I just felt the need to have reverse sorting for one of my blogs. I've got the blog titles as simply YYYY/MM format.

      I'm no Javascript guru, but I just tweaked the code slightly and to my amazement it worked.

      //Sort Alphebetically
      allResults.sort(function(a, b){
      var a_string = b.children[0].textContent ;
      var b_string = a.children[0].textContent ;

      Delete
    3. Thanks a lot, Alan. I invite any other readers to post their tweaks.

      Delete
    4. //Sort Alphebetically
      allResults.sort(function(a, b){
      var a_string = b.children[0].textContent ;
      var b_string = b.children[0].textContent ;

      just broke the logic, some funtion doesnt work in same different var. hehehe work fine sort by date

      Delete
  30. This is fantastic. Thank you.

    ReplyDelete
  31. I wanted to share that I tried this and it worked. The next piece I'm looking for is how to turn this into a drop down list as well. With that I will be set. Thanks for posting this solution.

    ReplyDelete
  32. Hi Mike,

    My list stopped working for me this morning, could you please check yours to see if there is a problem with it? Thanks

    ReplyDelete
  33. I changed the amount of 150 to 100 and now it is working, could you give me some feedback about this? Thanks

    ReplyDelete
    Replies
    1. Hi Azor. It's still working for me with maxResults = 150. I don't know why you had a problem. However, any value less than 150 will definitely work, so there's no harm in reducing the value to 100.

      Delete
  34. Hi Mike,

    I don't know what happened, but I just changed back to 150 and it is working again.
    I would like to ask you if it is possible to reverse the date to 11-27-2016?
    Thanks for replying.

    ReplyDelete
    Replies
    1. Play around with this line:
      a1E.textContent = title + " (" + date.substr(5,2) + '/' + date.substr(0,4) + ")";

      Delete
  35. http://maorisong.blogspot.co.nz/2017/01/a-z.html Cheers!!

    ReplyDelete
    Replies
    1. I'm glad I could be of assistance. Happy New Year!

      Delete
  36. Wow, very nice job. It took me a few days to find your to list my posts. You did it perfectly. It's better than using the labels (no comments box appears when you click on labels that show posts) and it's better than the general blog archive widget. Thanks so much. Kathy www.cosmicclues.com

    ReplyDelete
    Replies
    1. I'm glad the code helps. It's not a replacement for labels. Labels have their use as well. I wish Google would pay attention to users and offer an official alphabetic feature. They can even use my code if they want to :)

      Delete
  37. Hi Mike,

    Yesterday I had a Windows 10 update and since then the list doesn't work anymore. Could you please let me know if I have to change anything to make it back to work. Thanks

    ReplyDelete
    Replies
    1. There's no reason why a Windows update should change anything. The only possibility I see is that there's a change in the security settings on your computer that blocks Javascript.

      Delete
  38. I wrote a comment before telling you that the search code stopped working on my blog, but I don't see the comment here anymore. Could you please check the blog https://cs-mm.blogspot.com and let me know what can be causing to stop. Thanks

    ReplyDelete
    Replies
    1. A few months ago I was forced to introduce comment moderation because of a large amount of spam. Your comments are immediately visible to me, but nobody else can see them until I accept them as genuine. This might take a few hours, depending on whether I'm asleep or at work, but it won't take long.

      What's the exact page of your alphabetical list? I still suspect it's a problem with Javascript settings.

      Delete
  39. Ok, sorry to send you two comments.

    Here is the page where the searches are

    https://cs-mm.blogspot.com/p/main-menu.html. They are under the icon Search +, you have to click on it and hold/drag to the desire search

    Thanks

    ReplyDelete
    Replies
    1. Your page doesn't load at all. Have you changed the URL? For non-existent pages in a blog there's no error because the user is redirected to a default page. The URL you are using is http://cs-mm.blogspot.com/p/downloadable-alphabetical-post-list.html

      Delete
  40. This page doesn't load anymore. It started since yesterday after a Windows 10 update. I didn't change anything to your code at all. I already tried your code in another page and it doesn't load at all, but if I change the 150 to hight will load, but won't show all the posts.. Thanks for all your help

    ReplyDelete
  41. I set up a page called TESTING PAGE in the same menu that the searches are and I changed the var maxResults = 250;, please go and click on that page, it comes up but not all the posts, but at 150 it doesn't show anything, could this be because of 7500 posts that I have?

    ReplyDelete
    Replies
    1. If maxResults is set too high only a small selection of the posts will be shown. I think the problem is caused by your high number of posts. It takes a long time to load all the results. The browser probably abandons the page because the loading time is too long. That's my theory. I'll look into it.

      Delete
  42. Hi Mike,

    I live in Massachusetts, USA and I am using windows 10, I just talked to a friend of mine in Portugal that daily frequents the blog, he uses windows 7 and he told me that he can open the searches very quick. As I told you, everything was fine until the windows 10 update yesterday

    ReplyDelete
    Replies
    1. I use Windows 8, and I can't load your alphabetical list. Try something, please. Can you see MY alphabetical list at http://dansator.blogspot.de/p/alphabetical-list.html ?

      Delete
  43. I just reversed the 7500 post and let 7499 and the search works. So it means that I can't use 7500? Is there any way to fix this? Can you go there and check if it opens? Thanks for your help

    ReplyDelete
    Replies
    1. I just tried it. It works perfectly. I see exactly 7499 posts in your list. There's nothing in the code that should stop it working at 7500 posts. There must be some sort of limit in the Javascript environment. I'll try to find out for you.

      Delete
    2. One more thing: create two more posts and try again. I want to know if it works with 7501 posts.

      Delete
    3. I published two more posts and it works.

      So, from now on it will work when I post?

      Delete
    4. It's a subtle error. I'll try to get it fixed. The page won't load when the number of posts is divisible by 150. It was a cure coincidence that the error showed up at the same time as your update to Windows 10.

      Delete
  44. Yes it was really a coincidence, that's why I thought that was windows update the problem and also the posts that I published add up on 7500.
    This search is a BIG help for me and for a lot of people.
    I will come back here to check if there is a fix
    Thanks again for your help

    ReplyDelete
  45. I'm glad to have found this post. I recently started a blog of everyday family recipes and wanted an alphabetical index. This does the trick perfectly!
    Blog is: Rumble in the tumble

    ReplyDelete
    Replies
    1. You're welcome. I see your blog is relatively new at the moment. When you have a hundred or more recipes together an alphabetical list will be essential. It's best to start soon.

      Delete
  46. Hi Mike,

    I am having a problem, two of my posts don't go to the order that they should go, they stay at the top, couldn't you please let me know why? Thanks
    https://cs-mm.blogspot.com/p/downloadable-alphabetical-post-list.html

    ReplyDelete
    Replies
    1. That's funny. I can't see anything wrong. My only suggestion is that you check the posts to see if you've put a blank at the beginning of the title. If that's not the case I'm stumped.

      Delete
    2. It was the spaces in the beginning.

      Thanks a lot again

      Delete
    3. Ha! I made a good guess. I'm glad it's fixed now.

      Delete
  47. Hi Mike,

    I got a problem, let's see if you can solve it.

    I opened another blog, with a Blooger Standard Template and I am trying to run the alphabetical post list but doesn't show up

    https://gotmusiczone.blogspot.com/

    Thanks

    ReplyDelete
  48. Sorry, forgot to tell you , uou probably can't get in it's private unless I send you an email here's mine in case you want to get in musictrunk@gmail.com

    ReplyDelete
    Replies
    1. I suspect the problem is because it's private. The script isn't recognised as an authorised viewer.

      Delete
  49. Hello. The script works perfect. But can you tell me how I can exclude some few, particular posts NOT to be shown on the list?

    Thanks

    ReplyDelete
    Replies
    1. Hi Sven. As I mentioned above, I'm not the programmer of this code. It was supplied by a friend of mine. If you tell me exactly what posts you want to exclude I can ask him, but I can't guarantee that he'll have time to make the changes.

      Delete
  50. Hi Mike. Probably the easiest would be to exclude a bloggerpost from the list via the post ID's or title or URL(doesnt matter). So when he maybe able to add one or two lines of code for excluding a specific post ID's or title or URL, that would be great. Thanks

    ReplyDelete
  51. Hello Mike. I have the blog ID or the URL of the specific blog posts I want to exclude. Maybe he can code such en exclude option with a few lines of code? Thank for help!

    ReplyDelete
  52. Hi Mike,
    I have a problem with the Alphabetical code, it stopped working when it reached 11,102. When you have a chance could you please let me know if there is anything I can do to get the code to work?
    Thanks

    ReplyDelete
  53. OMG. It stopped at 11,100, but I posted two more and it is working now

    ReplyDelete
    Replies
    1. That's right. There's a bug in the code that stops it working at multiples of 150. 11100 = 74 * 150. I've asked the programmer to look at it, but he hasn't had time. Maybe someone else can fix it?

      Delete
  54. I don't know how to fix it and I don't know nobody that could fix t either.
    Just hope it doesn't die on me. Thanks for your quick reply

    ReplyDelete
  55. Replies
    1. I see your blog address is no longer valid. What's your new address?

      Delete
    2. Now it's taking a long time to open

      Delete
    3. Okay, Azor. The list works, but it's very slow. The page took almost three minutes to load, even though I have a fast computer and a fast Internet connection. The problem is that the algorithm uses a variation of the Bubble Sort, which is inefficient for large lists. On my blog (2,800 posts) the script needs about 30 seconds to sort. On your blog (11,000 posts) it needs 180 seconds. You just have to accept that the more you post the slower it will get. Change the warning text. Instead of "between 5 and 15 seconds" write "a few minutes" :(

      Delete
    4. I have myself a fast computer too i7 with DSL and it was opening always between 10 to 15 seconds, but when it reached the 11,100 it started to slow down, but even now sometimes it still opens within 15 seconds. Well, maybe I will have to open another blog. Thanks for all your help

      Delete
  56. I know who can fix it, or at least he has a clue about what he is doing. He adjusted me the script so that i can exclude some specific posts from showing up (simply by adding the post id in the script). He will do that for 5 or 10 bucks on fiverr. If you want to know more, please reply.

    ReplyDelete
    Replies
    1. Thanks, Sven, but look at it from my point of view. I'm not selling the script, I'm giving it away for free, so I'm not willing to invest any money in it.

      Delete
  57. Mike wasnt against you :) Just wanted to say that the script is awesome and im using it because as well. I just needed some small customization as I already replied here last december because I needed that adjustment. And Im glad someone was able to help.

    ReplyDelete
  58. Hi Mike,

    Do you know that the Import Option on Blogger doesn't work after so many posts. I can't import my blog to another blog anymore and I have a cousin of mine in Portugal with the same problem. I message google and they didn't give me a concrete answer about this problem, they asked me to do a very complicated thing that I would not dare to do, or open another blog. Be careful with your posts, I don't know if it makes difference between your posts and mines, but after so many posts it gets stuck and only gives errors to try again.

    ReplyDelete
    Replies
    1. How did you contact Google? I'm not aware that Google offers support. Whenever I needed help I asked a question in the forum, and there are a few experts who are quick to answer questions.

      Delete
  59. Mike, thanks so much for the code! It was a big help. I didn't want alphabetization...I wanted the posts to be sorted chronologically newest to oldest. I managed to tweak your code to do (mostly) what I wanted, though I did it in a completely wrong/hacked/workaround way. (I don't know anything about javascript or coding, so I just kept reading your code and twiddling with it, trying to figure out what was happening.) I got it to sort by date only by appending the date at the beginning of the titles. I really don't want the dates to show in the list, just the titles. But this will do for now, it's a whole lot better than nothing! Here's a link to my blog: The list of posts is on the side in a scrollbox. Thanks again!!!
    http://writing-uphill.blogspot.com/

    ReplyDelete
  60. Hi Mike

    My code stopped working, tried Google, Firefox and Opera and doesn't open. Do you know if there is any problem with it, Thanks

    ReplyDelete
    Replies
    1. As far as I can tell it works fine, except when the number of posts is a multiple of 150.

      Delete
  61. It is very nice. But, i have one doubt about "where to paste this code in html, before or after tag like before head tags

    ReplyDelete
    Replies
    1. I haven't tried to post this into a standalone HTML page. It might be possible, I don't know. I use it in a blogger page, and it's the whole file. The blogger software inserts it in the right place.

      Delete
  62. Thanks! have been using this with a label feed to list every apple I've written up. adamapples.blogspot.com

    Google should write a sidebar widget that does this. With a chronological option for travel bloggers.

    ReplyDelete
    Replies
    1. I'm glad the code is useful for you. I've taken a brief look at your blog. It's fascinating.

      Delete
    2. Fascinated to read the apple blog. To be fair to yourself and to Mike, add a link back to this page this to the bottom of your sort page. It'll serve to remind you where you got the script and help others, too.

      Delete
    3. @Alan, that is flattering.

      As it happens, I have another blog solely about Blogger. I have linked to, and recommended, this post (and credited Matt and Mark) in a post there:
      https://too-clever-by-half.blogspot.com/2023/01/super-tech-fun-pak.html

      Delete
    4. Thanks, Adam, but my name is Mike, not Mark :)

      Delete
    5. Gosh, Mike, I am embarrassed. For what it's worth, I get your name right in the blog post.

      Delete
  63. Chrono Score Guy19 April 2020 at 02:03

    Well, it has been a while. I wanted to say I have been sucessfully using your code for years, but another glitch has occurred and I'm hoping you might be able to help. In addition to the list not showing every 150 posts, a number of posts are now showing twice.

    My post list is here: https://chrono-score.blogspot.com/p/all-albums.html

    Any help you can offer would be appreciated.

    ReplyDelete
    Replies
    1. You're using a modified version of my code. I tried my original code, as on this page, and there are no duplications. See https://dansator.blogspot.com/p/test-page.html

      Delete
    2. Strange. When I originally posted it, I did remove the mention of the date but that's it. I took the original code, removed the date again and reposted it and it worked. Maybe I made some other adjustment accidentally along the way. Either way, thanks for your help. It's now fixed. :)

      Delete
  64. Just tried this with my blog and it's worked! Many thanks for making my life a little easier xx
    https://wossnimsblog.blogspot.com/p/archive.html

    ReplyDelete
    Replies
    1. I see that your blog is still fairly new. It's good that you're thinking about an alphabetical list already. I waited slmost two years before I panicked and realised I needed an alphabetical list.

      Delete
  65. Hello Mike can you explain how to list just one category of my blogspot?
    Thanks great script!!!

    ReplyDelete
    Replies
    1. It's not possible with the script as written. I can't help you, sorry. You need to find a programmer.

      Delete
    2. Actually I am using the script this way on my blog. Just use the label feed instead of the blog feed.

      Delete
    3. The place in the script that specifies the blog feed includes this string in the 11th line of code:

      /feeds/posts/summary

      That is specifying the general blog feed. To use a label feed for the label "reviews" (for instance), change that to be

      /feeds/posts/default/-/review

      I hope it is obvious that you just substitute the label name for "reviews" in my example.

      Label names are case sensitive, so get it exactly right.

      It is possible to do this with any feed. Google describes the morphology of different Blogger feeds here:

      https://support.google.com/blogger/answer/97933?hl=en

      Thanks again for posting this script.

      Delete
    4. Thanks a lot, Adam. I've learnt something new :)

      Delete
  66. Thanks! I wanted my list to be chronological rather than alphabetic, so I just removed the command to sort the list (since it already starts out chronological), but this is exactly what I wanted.

    http://pathwaytools.blogspot.com/p/list-of-all-posts.html

    ReplyDelete
  67. Hi, your code works fine, but when change my blog from public to private the code stop working, how i fix that?

    ReplyDelete
    Replies
    1. I'm sorry, the code doesn't work with private blogs. There's no way I know to fix it, apart from making the blog public. I apologise.

      Delete
    2. If you find a fix, please let me know.

      Delete
  68. Hi Mike,

    Hope everything is OK with you. I have been using this script for a long time, now I have almost 10,000 posts on my blog and it takes sometimes more than 1 minute to open the list, and my question is, there is anyway to make the list open faster? Thanks

    ReplyDelete
    Replies
    1. I'm sorry. No speed improvement is possible without completely rewriting the code. It works perfectly for "normal" blogs with less than 2000 posts. I'm already at 4423 posts, and it's starting to slow down. You have even more posts than me.

      Delete
  69. I have another question, is there a way to change the date to the beginning https://azormusic2021.blogspot.com/p/date-download-list.html

    ReplyDelete
    Replies
    1. a1E.textContent = title + " (" + date.substr(0,10) + ")";

      change to

      a1E.textContent = "(" + date.substr(0,10) + ") " + title;

      Delete
  70. Hello
    Any way to make it show the posts like in the default''Popular Posts'' section or similar?

    ReplyDelete
  71. Hello. At last month or so, the script is not working at all. Did somebody got the same problem?
    https://www.eurekashop.gr/2008/03/blog-post_8822.html

    ReplyDelete
    Replies
    1. I've noticed sporadic failures, i.e. It doesn't work until I add a new post. I've found a workaround by adding a test post to my blog every time the alphabetic list stops working, but that's not a satisfactory solution. I no longer have any contact with the script's original programmer. I need to find a Javascript programmer who can find the reason for the problems and rewrite the code.

      Delete
  72. Hi Mike,
    Great script and something I really need.
    However the sort is not fully completed when its added to the html code :(
    Do you know why?
    See:
    https://np.works

    ReplyDelete
  73. Thanks. The script worked. I made minor changes to the script remove appending of the published date and made the sorting case insensitive.

    ReplyDelete
    Replies
    1. I'm glad you like it. Can you give me a link to your page and the altered script, please. If you're proficient with Javascript, maybe you can help me fix an irritating bug. When the number posts is an exact multiple of maxResults, the page isn't generated.

      Delete
  74. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. I have no idea why that is. I started my blog in September 2010, and all the posts are listed. As far as I know, Azor has more posts than anyone else who uses my blog, so he would be the first to see a problem.

      Delete
  75. Hey Mike. It happened, I got past the 150 posts and it seems that only 150 posts are shown. Post 151 and older not anymore. Do you maybe have any solution for this?

    Thanks

    ReplyDelete
    Replies
    1. There's a known bug when the number of posts is an exact multiple of maxResults, which is 150 posts on your blog. So just write another post, and it'll work again.

      I've now changed maxResults to 100. I experimented a bit, and this lower value speeds up the creation of the list.

      Delete
    2. Eureka! I had problems displaying all my blog titles (it was only doing 150) but now that I've change maxResults figure to 100, it now lists everything. 269 on one blog and 245 on another.

      Delete
    3. Hi Alan. It's not the end of the problem, unfortunately. You'll have the problem gain when you reach your 300th post, but it should work again when you have 301 posts. It's an annoying little bug. I'm calling anyone who knows Javascript to tell me how to fix the bug.

      Delete
  76. Mike, to Sven you wrote above, "So just write another post, and it'll work again." But Sven is saying that it didn't work again. And so am I. I don't have anything more constructive to add, so I'll leave it there.

    ReplyDelete
  77. MIke, I've dabbled. And tested.

    Change this:
    if (feed.entry.length >= maxResults)
    {
    startIndex += maxResults;
    sendQuery12();
    } else {
    printArrayResults();
    }
    }
    }
    sendQuery12();


    To

    if (feed.entry.length = maxResults)
    {
    startIndex += maxResults;
    sendQuery12();
    }

    if (feed.entry.length > maxResults)
    {
    startIndex += maxResults;
    sendQuery12();
    }

    else {
    printArrayResults();
    }
    }
    }
    sendQuery12();

    ReplyDelete
    Replies
    1. Thanks Alan. I'll try it out. My blog has 5738 posts, but my code is used by at least one person with a much bigger blog. I have a small test blog which I'll use to test your code before recommending it to everyone.

      Delete
  78. This is really great. I have a private blog, but I can toggle to public to generate the HTML that I can periodically paste into a static Post or Page or Sidebar. But, I have some weirdness. In a Post or a Page, I get TWO of every post. In the sidebar HTML gadget it's only one - works great. Same code pasted everywhere. Any ideas?

    Also, I noticed that it can only run once. It shows on my sidebar if I don't have the Page or Post up, but if either is showing, the sidebar doesn't work and the Page or Post does.

    ReplyDelete
    Replies
    1. I don't understand what your problems are. All I can say is that I've heard from other users that it doesn't work well in a sidebar. The problem is probably that the space is too narrow.

      Delete
    2. "Only runs once" is expected behavior, I believe, given the design of the script.. A workaround is to duplicate the code and give the functions different names throughout. An experienced programmer (certainly not me) could set things up more efficiently.

      Delete
  79. Thank you for making this code available to us.
    It works perfectly (EDGE) and without any problems.

    I know almost nothing about ‘HTML’ coding but fortunately I know how ‘BLOGSPOT.com’ works very well because I think it would be difficult for a beginner to use your method’.

    So ‘Many thanks’ from Istanbul.

    PS. Liège - Gya @ https://liegegya.blogspot.com/

    ReplyDelete

Tick the box "Notify me" to receive notification of replies.