September 03, 2003
POSTLETTES: How to create sidebar posts
by Liza Sabater
I am sooooooo excited I could scream.
One of the things that most annoys me about the Typelists is that whatever you do with that section does not count as an update on your site. This is annoying because even though I look at dozens upon dozens of sites on a daily basis, I am not interested in writing a full-blown article about them AND YET I do want to include a line or two on my site --AND HAVE THAT RECORDED AS AN UPDATE TO MY BLOG AS WELL.
Hence the postlettes.
I've been hitting the MT manual for weeks, trying to figure out how to use the technology available to TP in order to create THE TYPEPADISTA DIRECTORY. This was more about a matter of principal. I could have gotten Javascript heavy on the site and use my server in order to create forms and polls and the like but that would have diverted my attention from the innards of TP.
Well, I think I have found a way to include little posts or postlettes into your blog by playing around with the MT markup.
"Are you ready? I can't here you! Ohhhhhhhhhhhhhhhhhhhhhhhhhhh"
Here is what you will need to do:
1. PARSE CATEGORIES
2. IDENTIFY MAIN BLOGGING CATEGORIES ON THE INDEX PAGE
3. CREATE A POSTLETTES MODULE.
4. INSERT IN SIDEBAR
5. RINSE AND REPEAT
1. PARSE CATEGORIES
You need organize your content by categories in order make this little miracle happen.
After you decide which categories you want for the main blog area and which you want to use for sidebar postlettes, make sure you have kept your orthography and punctuation consistent throughout the categories. MT is very sensitive to writing mistakes. If you wrote in your category section "bOoks" instead of "Books" and you include the correctly-cased word in your template, the system will not be able to find the word and you will get pelted with tons of errors. So check your spelling and keep consistent throughout this exercise.
2. IDENTIFY MAIN BLOGGING CATEGORIES ON THE INDEX PAGE
Now that you know what you want for the main blog, we have to tell the index page to only get that information and publish it in the "content" area. It really only takes a snippet of MT markup.
Let's use the categories "Current Affairs" and "Politics" and "Gossip" for the main section. I am using 3-columns in my site, so my main content area is under the "center" div tag
<##div id="center">
<##div class="content"li>
<##MTEntries lastn="5">
(*Take the "##" out of the beginning of the code or it will not work.)
As you can see, I have set the main entries are to show the last 5 entries. This is where we will tell the INDEX page that we want it to show only posts that fall under the categories of "Current Affairs" and "Politics":
-
<##MTEntries category="Current Affairs OR Politics OR Gossip" lastn="5">
Now, why am I using OR instead of AND? Because the system uses boolean searches. That's also the reason why you should use uppercase. You want an either/or situation, you do not want the system to look for all the words together in a string (or sentence).
Save your work. Do not publish yet.
3. CREATE A POSTLETTES MODULE.
You do not want to put this code into either of your sidebars without protecting what you already have there. I suggest that, if you've been cramming code into those section, start cleaning up and packing away code into modules. You'll thank me later.
Call the module POSTLETTES. At this point, it is your call whether want to put all the postlettes into one modules or separate them into categories as well (ie: POSTLETTES BOOKS, POSTLETTES MOVIES).
Now we're going to the bit of coding for a postlette section dealing with books:
-
<##h2>BOOKS
<##$MTEntries category="Books" sort_by="title" sort_order="descend" lastn="3"$>
<##div class="link-note">
<##a href="<$MTEntryPermalink$>"><##$MTEntryTitle$><##/a>
<##div class="link-note-small">
<##$MTEntryBody convert_breaks="0"$> (<$MTEntryDate format="%d %b %Y"$>)
<##/MTEntries>
<##/div>
<##/div>
Once you've cut, pasted and clean out the "##" from the code, SAVE YOUR WORK!!
4. INSERT IN SIDEBAR
Now use the code:
<##MTInclude module="POSTLETTES">
to include it in which ever sidebar (that should be the one that is widest, usually the right-hand side one. Also, do not forget to put the code inside
Once done SAVE AND REBUILD YOUR SITE. Nothing, and I mean, nothing will work until you do this. When you view your weblog, make sure you either refresh the cache of your browser or empty it completely and refresh. This is to make sure you are actually looking at your work.
5. RINSE AND REPEAT.
***Notice that I did not include the div class="sidebar" at the top of the module. That's because it already resides inside the sidebar and once we call this module into it with the MTInclude tag, all the applicable formatting will fall into place.
Also notice these bits of code:
- sort_by="title" sort_order="descend" Sorts the list alphabetically
- $MTEntryBody convert_breaks="0"$
- $MTEntryDate format="%d %b %Y"$
You know that pesky space that you get in the Typelists? Well, the same would happen with your postlettes, if you do not disallow all paragraph spaces from these post. Instead of doing it globally, we are doing it on a case by case (or postlette module by postlette module) basis.
This will render the date as so: 03 Sept 2003
BTW, the dollar signs are there because it is 'mixed' in with the HTML code in certain places. Just put them in verbatim.
FYI!!!!!!!!!
I still have to work at adding a bit of code so that you can also have a link to the category page. Will get back to you on that.
Whew! That was about 5 hours work!
Posted by Liza Sabater in Blogs, Design
Permalink |
Comments (5)
| TrackBack (2) | Technorati Cosmos
Trackbacks
Trackback for this post:http://www.culturekitchen.com/cgi-bin/movabletype/mt-tb.cgi/264
The following blogs make reference to this post :
» Liza Sabater How-To: Creating Sidebar Postlettes from Channeling Cupertino
Liza does all the heavy MT lifting so you don't have to. b u r u n d a n g a: POSTLETTES: How to create sidebar posts When is somebody going to take the leap and write "Moveable Type [More...]
Found inSeptember 10, 2003 09:24 PM
» Handy info site for Movable Type and TypePad from spiel
Just stumbled over this, almost broke my mouse in my haste to add the link to my favorites. >> Empty Pages [More...]
Found inOctober 12, 2003 07:20 PM
Say it loud, say it proud!
Nice work!
2
Comment by: Madison at September 4, 2003 07:34 PM
thanks for your work! I'll try to implement this on my site and give you props there
3
Comment by: xian at September 6, 2003 05:02 PM
Is there a way to simply exclude a category from the main listings instead of explicitly including the rest?
Also, what about making the sidebar links a separate typepad blog and then including them? Is that possible?
4
Comment by: Michael Hanscom at September 10, 2003 09:44 PM
xian — it is indeed. I had that running as a 'sideblog' on my site for a while (though since my redesign, rather than being in a sidebar, the same information is on a page of its own...the technique is the same however). You can find my post about what I did right here: http://www.michaelhanscom.com/eclecticism/2003/08/destinations.html
5
Comment by: liza at September 10, 2003 11:06 PM
Hey Xian et al,
Let's start from your second question:
"Is there a way to simply exclude a category from the main listings instead of explicitly including the rest?"
Also, what about making the sidebar links a separate typepad blog and then including them? Is that possible?
While trying to perfect this postelletes idea, I trolled some tried and true MT resource sites and, of course, smacked my forehead on the wall. I should have gone first to none other than our Help Desks Brianna's gem of an MT resource, EmptyPages:
http://emptypages.org
I have been using that site as a reference from day 1 and for the life of me never saw her sideblog post. It uses SSI and I think it is exactly what Michael has offered as an alternative.
http://www.emptypages.org/more/tags/side_blog.html
She even includes pictures ... sigh!
If you look at her explanation, what she is giving you there is basically the blue-print for the Typelists. It is quite elegant.
STILL what I see as the one flaw of this method is that, again, each update to your list does not count as an update to your site. This is why I cracked my head trying to come with a way that the sidebar would not be a separate blog but an actually holder for smaller posts to the blog. This is where I see that the SSI tag fails ---your updates do not count as posts to the 'container' blog.
So, to go back to your first question:
"Is there a way to simply exclude a category from the main listings instead of explicitly including the rest?"
I have not found one yet, but that does not mean that there is not a way to do so. Given me another day to get back to you on that one.
Thanks for checking it out!


1
Comment by: Lisa at September 4, 2003 10:25 AM