Sticky Posts in TypePad

Sticky Posts in TypePad

One of the things I wanted from the very beginning on this blog was a way to permanently put a quick intro at the top of the page. Something like what you see when you first visit Seth Godin’s blog for All Marketers Are Liar’s. Of course Seth’s blog is custom coded on another platform, so I initially thought it was just something I’d have to live without on TypePad. Then I thought of all the wacked out requests I’ve made for features and how helpful TypePad’s help people have been in helping me find workarounds. So I opened a help ticket and asked for a way to do it and it turn’s out not to be all that hard after all.

You know, “if you never ask…”

So Last night I was reading an interesting post about Seth’s new project, Squidoo on Kate Trgovac’s blog. She had a really good point about how the nature of blogs doesn’t always show us in our best light… definitely worth a read and a bit of thought.

In the comments I offered to post the transcript of the help ticket that describes how to make a perma-post at the top of a blog. To read the transcript, just click on the link below for the extended entry.

Ticket Transcript:

On Jun 8, 2005 2:03:10 PM, you (john t.) said:

Okay, this is one I’ve been wanting to implement since day 1…

I’d love to have the first entry below the header be a permanent
“about me” paragraph that stays in place as an orientation to new
viewers. Until now the only example i could find was here:
http://www.allmarketersareliars.com/ Because it’s hosted elsewhere, i
sorta thought I might not be able to do the same thing with typepad.
BUT:

Look here: http://growabrain.typepad.com/growabrain/

Someone *has* pulled it off. I wonder if you could view source on
that page and tell me which part of the source code controls the
permanent entry at the top of the main page. I know I *can* figure this
out on my own, but I’m being cautious because I don’t want to totally
hose my templates by mistake…

The relevant part of the layout code is probably some, but not all, of the following:

<div id=”center”>
<div class=”content”><a
href=”http://growabrain.typepad.com/growabrain”
onfocus=”if(this.blur)this.blur()” title=”Gabby says click here to
return to main page” target=”_top”><img alt=”Gabby” border=”0″
src=”http://growabrain.typepad.com/photos/blogimages/gabby.gif”
width=”167″ height=”180″ border=”0″ class=”fl” /></a>
<br><br>
<!– EDIT THE TEXT HERE –>

Welcome to Grow-a-Brain, the “<a
href=”http://pierrotsfolly.blogharbor.com/gab3Lg_Prog001.mov”>Original
Real Estate Blog</a>”. My name is <a
href=”http://growabrain.typepad.com/about.html”>Hanan
Levin</a> and I am a co-owner of ‘The Champion’ Real Estate
Company in Riverside, California. I hope you enjoy this unique daily
blog and the world-famous collection of intelligent links below.

<br><br> You’ll find the full list of Grow-a-Brain links
on the sidebar to the left, or you can view them from the <a
href=”http://growabrain.typepad.com/growabrain/archives.html”>Extensive
archives page</a> – over 130 thought-provoking categories, from
“Advertising” to “Zen”, and from “Magic” to “Pulp Fiction”. The <a
href=”http://growabrain.typepad.com/thegreatteam”>Champion
Company</a> site is here, and you’ll find some of the <a
href=”http://growabrain.typepad.com/photos/riverside_apartment_build/”>Inland
Empire Apartment buildings</a> we recently sold there.
Many people made us happy by acknowledging the hard work that went into
this site; Take a peek at what <a
href=”http://growabrain.typepad.com/growabrain/people_are_talking_about_growabrain/index.html”>people
have been saying about Grow A Brain</a> here.

<!– STOP –>

<br>
<p style=”clear: left;”></fl>

Thanks,

John

On Jun 8, 2005 4:40:55 PM, TypePad Customer Support said:

Hi John,

The easiest way to do this is to create a special category that is
only for the “sticky” post that stays on top (this method also makes it
easy if you want to be able to put announcements up there too and
change the message on need). For the purposes of this example, we’ll
assume the category is called Annoucements.

Then, in your main index template, above the main listing of posts, you would put code like the following:

<MTEntries category=”Announcements” lastn=”1″>
… other tags go here…
</MTEntries>

In the middle you would put the template tags that display your post how you want it.

What this code does is that it looks in the Announcements category
for the most recent post in that category and displays it. As long as
your welcome post is the most recent post in the Announcements
category, it will be displayed. If you wanted to display another
announcement instead, you would write a new post and assign it to the
Announcements category, then make sure the date is more recent than on
the welcome message. The new post will be displayed there instead.

I hope this helps. Please let us know if you have any further questions or concerns.

Thanks,
Laura

On Sep 6, 2005 8:03:08 PM, you (john t.) said:

Hi Laura,

well I thought I was clear on what you were saying… or at least, I
get it in theory, but I’m not quite sure exactly how to apply it. I bet
you can help me out with a few additional questions:

1. you write:

<MTEntries category=”Announcements” lastn=”1″>
… other tags go here…
</MTEntries>

I’m not 100% sure what the “… other tags go here…” part means.

2. I’m not finding the exact right place in my current code to put this additional code.

3. do I need to create the category “Annoucements” before I implement the new code? or does it matter?

So I’d like to try this: I’ll paste the existing code for my main
index template below, and when you reply, perhaps you can copy the code
and insert the new code for the “sticky post” in the right place. Cool?
I feel a wee bit lame asking for such hand-holding on this, but I
really don’t want to accidentally fry my existing layout.

So here’s the full code for the existing advanced template which I want to modify:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<meta name=”generator” content=”http://www.typepad.com/” />
<MTBlogIfPrivate>
<meta name=”robots” content=”index,follow” />
</MTBlogIfPrivate>

<title><$MTBlogName$></title>

<link rel=”stylesheet” href=”<$MTBlogURL$>styles.css” type=”text/css” />
<link rel=”alternate” type=”application/atom+xml” title=”Atom” href=”<$MTBlogURL$>atom.xml” />
<link rel=”alternate” type=”application/rss+xml” title=”RSS” href=”<$MTBlogURL$>index.rdf” />
<link rel=”EditURI” type=”application/rsd+xml” title=”RSD”
href=”<$MTCGIPath$><$MTRSDScript$>/<$MTBlogID$>” />
<MTUserIfShow field=”foaf”>
<link rel=”meta” type=”application/rdf+xml” title=”FOAF” href=”<$MTUserSiteURL$>foaf.rdf” />
</MTUserIfShow>

<MTBlogIfCCLicense>
<$MTCCLicenseRDF$>
</MTBlogIfCCLicense>

</head>

<body>

<div id=”container”>
<div id=”banner-img”>
<div class=”img-link”><a href=”<$MTBlogURL$>”><span></span></a></div>
</div>

<div id=”banner”>
<h1><a href=”<$MTBlogURL$>” accesskey=”1″><$MTBlogName$></a></h1>
<h2><$MTBlogDescription$></h2>
</div>

<div id=”pagebody”>
<div id=”pagebody-inner”>

<div id=”left”>
<!–#include virtual=”/<$MTBlogDirname$>/sidebar1.inc”–>
</div>

<div id=”center”>
<div class=”content”>

<MTEntries>
<$MTEntryTrackbackData$>

<MTWeblogPostIfShow field=”date_header”>
<MTDateHeader>
<h2><$MTEntryDate format_weblog_date=”1″$></h2>
</MTDateHeader>
</MTWeblogPostIfShow>

<a id=”a<$MTEntryID pad=”1″$>”></a>

<MTWeblogPostIfShow field=”post_title”>
<h3><$MTEntryTitle$></h3>
</MTWeblogPostIfShow>

<$MTEntryBody$>

<MTEntryIfExtended>
<p class=”extended”><a
href=”<$MTEntryPermalink$>#more”><$MTTrans phrase=”Continue
reading”$> “<$MTEntryTitle$>”</a></p>
</MTEntryIfExtended>

<p><span class=”emailto”>
<a href=”mailto:?subject=Check out <$MTEntryTitle
remove_html=”1″$>&body=I thought this looked like your style:
<$MTEntryPermalink$>”>Email this post to a
friend!</a></span></p>
<p class=”posted”><$MTEntryDate format=”%B %e, %Y”$>
<MTEntryIfCategories><$MTTrans phrase=”in”>
<MTEntryCategories glue=”, “><MTBlogIfArchives
archive_type=”Category”><a
href=”<$MTCategoryArchiveLink$>”><$MTCategoryLabel$></a><MTElse><$MTCategoryLabel$></MTElse></MTBlogIfArchives></MTEntryCategories></MTEntryIfCategories>
| <a href=”<$MTEntryPermalink$>”>Permalink</a>
<MTEntryIfAllowComments>
| <a href=”<$MTEntryPermalink$>#comments”><$MTTrans
phrase=”Comments”$> (<$MTEntryCommentCount$>)</a>
</MTEntryIfAllowComments>
<MTEntryIfAllowPings>
| <a href=”<$MTEntryPermalink$>#trackback”><$MTTrans
phrase=”TrackBack”$> (<$MTEntryTrackbackCount$>)</a>
</MTEntryIfAllowPings>
</p>

</MTEntries>

</div>
</div>

<div id=”right”>
<!–#include virtual=”/<$MTBlogDirname$>/sidebar2.inc”–>
</div>

</div><!– pagebody-inner –>
</div><!– pagebody –>

<div style=”clear: both;”>&#160;</div>

</div>

<$MTStatsScript$>

</body>
</html>

 

On Sep 7, 2005 1:54:30 PM, TypePad Customer Support said:

Hi, John!

I believe what you need to do is copy:

<div id=”center”>
<div class=”content”>

<MTEntries>
<$MTEntryTrackbackData$>

<MTWeblogPostIfShow field=”date_header”>
<MTDateHeader>
<h2><$MTEntryDate format_weblog_date=”1″$></h2>
</MTDateHeader>
</MTWeblogPostIfShow>

<a id=”a<$MTEntryID pad=”1″$>”></a>

<MTWeblogPostIfShow field=”post_title”>
<h3><$MTEntryTitle$></h3>
</MTWeblogPostIfShow>

<$MTEntryBody$>

<MTEntryIfExtended>
<p class=”extended”><a
href=”<$MTEntryPermalink$>#more”><$MTTrans phrase=”Continue
reading”$> “<$MTEntryTitle$>”</a></p>
</MTEntryIfExtended>

<p><span class=”emailto”>
<a href=”mailto:?subject=Check out <$MTEntryTitle
remove_html=”1″$>&body=I thought this looked like your style:
<$MTEntryPermalink$>”>Email this post to a
friend!</a></span></p>
<p class=”posted”><$MTEntryDate format=”%B %e, %Y”$>
<MTEntryIfCategories><$MTTrans phrase=”in”>
<MTEntryCategories glue=”, “><MTBlogIfArchives
archive_type=”Category”><a
href=”<$MTCategoryArchiveLink$>”><$MTCategoryLabel$></a><MTElse><$MTCategoryLabel$></MTElse></MTBlogIfArchives></MTEntryCategories></MTEntryIfCategories>
| <a href=”<$MTEntryPermalink$>”>Permalink</a>
<MTEntryIfAllowComments>
| <a href=”<$MTEntryPermalink$>#comments”><$MTTrans
phrase=”Comments”$> (<$MTEntryCommentCount$>)</a>
</MTEntryIfAllowComments>
<MTEntryIfAllowPings>
| <a href=”<$MTEntryPermalink$>#trackback”><$MTTrans
phrase=”TrackBack”$> (<$MTEntryTrackbackCount$>)</a>
</MTEntryIfAllowPings>
</p>

</MTEntries>

</div>
</div>

and paste is immediately above the same code so that you have two identical blocks of code.

Then, change the first block’s <MTEntries> to <MTEntries category=”Announcements” lastn=”1″>

I would go ahead and create the new Announcements category and post
first so that you can see immediately if this is working or not.

I hope this helps!  Please let us know if you have any other questions.

Kymberlie

On Sep 7, 2005 2:07:15 PM, you (john t.) said:

Hi Kimberlie,

Wait, that doesn’t quite seem right to me to duplicate the code
twice… if only because some of the code you suggest duplicating deals
with stuff like the “email to a friend” link etc.

It seems like the <MTEntries category=”Announcements”
lastn=”1″> should go by itself into the block that handles
categories, right? I’m just not sure exactly where…

Can you maybe ask Laura to look at the questions also, since she is the one who suggested the new code?

I guess my basic questions are still

1. exactly where in my existing code (as referenced above) would I
add the new lines of code that Laura suggested so that they don’t break
anything.

2. as above:

<MTEntries category=”Announcements” lastn=”1″>
… other tags go here…
</MTEntries>

I’m not 100% sure what the “… other tags go here…” part means.

but i’m pretty sure that you are correct about making the new category “annoucements” before adding the code.

Thanks,

John

On Sep 7, 2005 4:36:36 PM, TypePad Customer Support said:

Hi, John!

I tested it out on my weblog to confirm and this code should work for you:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<meta name=”generator” content=”http://www.typepad.com/” />
<MTBlogIfPrivate>
<meta name=”robots” content=”index,follow” />
</MTBlogIfPrivate>

<title><$MTBlogName$></title>

<link rel=”stylesheet” href=”<$MTBlogURL$>styles.css” type=”text/css” />
<link rel=”alternate” type=”application/atom+xml” title=”Atom” href=”<$MTBlogURL$>atom.xml” />
<link rel=”alternate” type=”application/rss+xml” title=”RSS” href=”<$MTBlogURL$>index.rdf” />
<link rel=”EditURI” type=”application/rsd+xml” title=”RSD”
href=”<$MTCGIPath$><$MTRSDScript$>/<$MTBlogID$>” />
<MTUserIfShow field=”foaf”>
<link rel=”meta” type=”application/rdf+xml” title=”FOAF” href=”<$MTUserSiteURL$>foaf.rdf” />
</MTUserIfShow>

<MTBlogIfCCLicense>
<$MTCCLicenseRDF$>
</MTBlogIfCCLicense>

</head>

<body>

<div id=”container”>
<div id=”banner-img”>
<div class=”img-link”><a href=”<$MTBlogURL$>”><span></span></a></div>
</div>

<div id=”banner”>
<h1><a href=”<$MTBlogURL$>” accesskey=”1″><$MTBlogName$></a></h1>
<h2><$MTBlogDescription$></h2>
</div>

<div id=”pagebody”>
<div id=”pagebody-inner”>

<div id=”left”>
<!–#include virtual=”/<$MTBlogDirname$>/sidebar1.inc”–>
</div>

<div id=”center”>
<div class=”content”>

<MTEntries category=”Announcements” lastn=”1″>
<$MTEntryTrackbackData$>

<MTWeblogPostIfShow field=”date_header”>
<MTDateHeader>
<h2><$MTEntryDate format_weblog_date=”1″$></h2>
</MTDateHeader>
</MTWeblogPostIfShow>

<a id=”a<$MTEntryID pad=”1″$>”></a>

<MTWeblogPostIfShow field=”post_title”>
<h3><$MTEntryTitle$></h3>
</MTWeblogPostIfShow>

<$MTEntryBody$>

<MTEntryIfExtended>
<p class=”extended”><a
href=”<$MTEntryPermalink$>#more”><$MTTrans phrase=”Continue
reading”$> “<$MTEntryTitle$>”</a></p>
</MTEntryIfExtended>

<p><span class=”emailto”>
<a href=”mailto:?subject=Check out <$MTEntryTitle
remove_html=”1″$>&body=I thought this looked like your style:
<$MTEntryPermalink$>”>Email this post to a
friend!</a></span></p>
<p class=”posted”><$MTEntryDate format=”%B %e, %Y”$>
<MTEntryIfCategories><$MTTrans phrase=”in”>
<MTEntryCategories glue=”, “><MTBlogIfArchives
archive_type=”Category”><a
href=”<$MTCategoryArchiveLink$>”><$MTCategoryLabel$></a><MTElse><$MTCategoryLabel$></MTElse></MTBlogIfArchives></MTEntryCategories></MTEntryIfCategories>
| <a href=”<$MTEntryPermalink$>”>Permalink</a>
<MTEntryIfAllowComments>
| <a href=”<$MTEntryPermalink$>#comments”><$MTTrans
phrase=”Comments”$> (<$MTEntryCommentCount$>)</a>
</MTEntryIfAllowComments>
<MTEntryIfAllowPings>
| <a href=”<$MTEntryPermalink$>#trackback”><$MTTrans
phrase=”TrackBack”$> (<$MTEntryTrackbackCount$>)</a>
</MTEntryIfAllowPings>
</p>

</MTEntries>

</div>
</div>

<div id=”center”>
<div class=”content”>

<MTEntries>
<$MTEntryTrackbackData$>

<MTWeblogPostIfShow field=”date_header”>
<MTDateHeader>
<h2><$MTEntryDate format_weblog_date=”1″$></h2>
</MTDateHeader>
</MTWeblogPostIfShow>

<a id=”a<$MTEntryID pad=”1″$>”></a>

<MTWeblogPostIfShow field=”post_title”>
<h3><$MTEntryTitle$></h3>
</MTWeblogPostIfShow>

<$MTEntryBody$>

<MTEntryIfExtended>
<p class=”extended”><a
href=”<$MTEntryPermalink$>#more”><$MTTrans phrase=”Continue
reading”$> “<$MTEntryTitle$>”</a></p>
</MTEntryIfExtended>

<p><span class=”emailto”>
<a href=”mailto:?subject=Check out <$MTEntryTitle
remove_html=”1″$>&body=I thought this looked like your style:
<$MTEntryPermalink$>”>Email this post to a
friend!</a></span></p>
<p class=”posted”><$MTEntryDate format=”%B %e, %Y”$>
<MTEntryIfCategories><$MTTrans phrase=”in”>
<MTEntryCategories glue=”, “><MTBlogIfArchives
archive_type=”Category”><a
href=”<$MTCategoryArchiveLink$>”><$MTCategoryLabel$></a><MTElse><$MTCategoryLabel$></MTElse></MTBlogIfArchives></MTEntryCategories></MTEntryIfCategories>
| <a href=”<$MTEntryPermalink$>”>Permalink</a>
<MTEntryIfAllowComments>
| <a href=”<$MTEntryPermalink$>#comments”><$MTTrans
phrase=”Comments”$> (<$MTEntryCommentCount$>)</a>
</MTEntryIfAllowComments>
<MTEntryIfAllowPings>
| <a href=”<$MTEntryPermalink$>#trackback”><$MTTrans
phrase=”TrackBack”$> (<$MTEntryTrackbackCount$>)</a>
</MTEntryIfAllowPings>
</p>

</MTEntries>

</div>
</div>

<div id=”right”>
<!–#include virtual=”/<$MTBlogDirname$>/sidebar2.inc”–>
</div>

</div> <!– pagebody-inner –>
</div> <!– pagebody –>

<div style=”clear: both;”>&#160;</div>

</div>

<$MTStatsScript$>

</body>
</html>

The “other tags go here” part refers to the information that each post
has – its title, the date header, showing comments, etc. This is
controlled by this part of the code:

<MTWeblogPostIfShow field=”date_header”>
<MTDateHeader>
<h2><$MTEntryDate format_weblog_date=”1″$></h2>
</MTDateHeader>
</MTWeblogPostIfShow>

<a id=”a<$MTEntryID pad=”1″$>”></a>

<MTWeblogPostIfShow field=”post_title”>
<h3><$MTEntryTitle$></h3>
</MTWeblogPostIfShow>

<$MTEntryBody$>

<MTEntryIfExtended>
<p class=”extended”><a
href=”<$MTEntryPermalink$>#more”><$MTTrans phrase=”Continue
reading”$> “<$MTEntryTitle$>”</a></p>
</MTEntryIfExtended>

<p><span class=”emailto”>
<a href=”mailto:?subject=Check out <$MTEntryTitle
remove_html=”1″$>&body=I thought this looked like your style:
<$MTEntryPermalink$>”>Email this post to a
friend!</a></span></p>
<p class=”posted”><$MTEntryDate format=”%B %e, %Y”$>
<MTEntryIfCategories><$MTTrans phrase=”in”>
<MTEntryCategories glue=”, “><MTBlogIfArchives
archive_type=”Category”><a
href=”<$MTCategoryArchiveLink$>”><$MTCategoryLabel$></a><MTElse><$MTCategoryLabel$></MTElse></MTBlogIfArchives></MTEntryCategories></MTEntryIfCategories>
| <a href=”<$MTEntryPermalink$>”>Permalink</a>
<MTEntryIfAllowComments>
| <a href=”<$MTEntryPermalink$>#comments”><$MTTrans
phrase=”Comments”$> (<$MTEntryCommentCount$>)</a>
</MTEntryIfAllowComments>
<MTEntryIfAllowPings>
| <a href=”<$MTEntryPermalink$>#trackback”><$MTTrans
phrase=”TrackBack”$> (<$MTEntryTrackbackCount$>)</a>
</MTEntryIfAllowPings>
</p>

You can delete or add information at you see fit.

If you’re unsure how this is going to look, you may want to create a
test blog and mess around with the code until you feel comfortable that
it looks how you want it to.

I hope this helps!  Please let us know if there is anything else we can do for you.

Kymberlie

PS  My mother’s maiden name is Unger.  🙂

On Sep 13, 2005 3:45:39 PM, you (john t.) said:

Kymberlie,

Cool! It took a little tweaking, but I finally managed to get it to work just right. Thanks for the help!

Oh, and cool that our families shared a name in common at one time, eh?

John