Mint: Overriding Page Titles

So your server passed the Compatibility Suite and now Mint is totally rocking your world. You can’t get enough of the cool Pepper that lots of talented people are churning out every other day. You’ve even dabbled in developing your own but…there’s always a “but,” right?

You are using Mint on a site with a CMS. Your page titles look something like "Site Name / Section Name / Title of the Actual Content on this Page." In Mint (and some browser tabs) that title gets trimmed down to "Site Name / Section Name..." You sound like you might be interested in this undocumented (until now) feature.

Add the following <script> tag to your templates before the Mint JavaScript include <script> tag:

<script type="text/javascript" language="JavaScript">
// <![CDATA[
var Mint_SI_DocumentTitle = '<%TITLE%>';
// ]]>
</script>

Replace <%TITLE%> with the template tag/variable that represents your content/article title (be sure to encode the title properly for use in a single quoted JavaScript variable).

Here’s the above code customized for use with Movable Type:

<script type="text/javascript" language="JavaScript">
// <![CDATA[
var Mint_SI_DocumentTitle = '<$MTEntryTitle encode_js="1"$>';
// ]]>
</script>

That’s all there is to it. Now, instead of "Site Name / Section Name..." you’ll be see something much more useful, "Title of the Actual Content on this Page". It will take a while for previously recorded hits with the original page title to expire but all the “Recent” views will reflect this change immediately.

Questions about Mint or this technique? Check out the Mint Forum—it’s good for what ails you.

Previous
Treehouse
Next
Enablr
Author
Shaun Inman
Posted
October 5th, 2005 at 11:56 pm
Categories
Mint