"Listing of Contents" Widget

Please click on the title to go to the updated page.


Hans said...

Hi Hoctro: nice hack! After adding it to my Blog it didn't work, until I checked your code and discovered it will only be shown on item-pages. Might be a good idea to add that to the description.

Hoctro said...

Hi Hans,

That's right!!! I reverse the code from my "related article" hack, and forgot to delete the two lines for the if's out. Let me correct that.

Through learning the internal structure of the "Archive" widget, I realize that it is possible to call a function recursively, I hope advance users see this point. I hope to have time to talk about the intricate, behind the scene hacking activities in a separate article. I didn't want to confuse my readers, so I follow yours and Ramani's clear and simple writing styles.


Reaktori said...

Hi Hoctro!
Nice hack! I have to say I like it more than that "Table of contents"-hack. It is easy to put in order.
BTW. may I translate some your hacks to my blog?

Hoctro said...



Sure, just make sure the translated contents are for public's use, free, and proper links back to my page. You can see I demonstrated my thinking on this on how I made the translation widget.

Thanks for asking. I saw some incidents on the web already, taking my contents without my consent, so it's really nice of you to ask.

Manas said...

Waiting for ur related posts hack.. :)

Hoctro said...

me too :) i'll try to write up sth nice tomorrow. the code is finished already, I just don't like much for the fact that JavaScript doesn't have trim() command, and I hate to write one up from scratch. But you can see that there's no free lunch, in that one has to add the "custom label/category" onto each post, like I've been doing with my titles. Then I can make this "related hack" works, as you can see.

Mario said...

I like this hack a lot, only I would like to have the contents in reverse order. I want the earliest post first on the list, and the latest post last on the list. It seems like this would be an easy thing to do, but I can't make it work. Can anyone help me tweak this hack to get the result I want?


Hoctro said...


Indeed this is easy! Please take a look at my revised post to see how it could be done.


Mario said...

Thank you hoctro. It worked beautifully. You are my hero.