« How to add content between your blog and the top of the browser | Main | Cool New Comment Notification emails »

John T. Unger

3 Custom Template Modules You'll Use Again and Again

John T. Unger April 22, 2007

The entry-individual, entry-list and entry-list-sticky modules may be familiar to those of you who've hacked around with your templates much. All three of them are responsible for generating the post content on different pages of TypePad blogs, and all three are ripe for customization.

These three modules will feature heavily in some of the tutorials I've been wanting to write lately. Rather than repeat instructions for creating and including these modules in each upcoming post I'll document them here and link back for those who haven't already included these in their templates. These three templates all kind of "go together," that is, in most cases if you plan to edit one, you'll be working with all three.

If you've already created these modules for your blog, you can skip the extended entry of this post. All it contains is instructions for creating the standard modules… I'll get to customization options in upcoming tutorials.

Creating a new template module is pretty simple, so long as you know what it does and which of the other templates for your blog reference it. It seems really complicated at first, so if the explanation below sounds daunting, scroll down to the instructions and breathe a sigh of relief… it can be a bit harder to explain than it is to actually do.

Typepad templates are nested, which means that within each template you can use "includes"  to  share reusable components between templates. The upside of this system is that you can make changes to a  single module and have it take effect across your entire blog without having to manually edit all the files. The downside is that sometimes it can be hard to figure out which module is generating a specific component of your blog because it's hidden within a template that isn't listed on your design page. For instance, if you want to change the order or display of items in your footer, you need to edit the MTEntryPostFooter module, which is found within the entry-individual, entry-list and entry-list-sticky modules. But these modules are generated automatically when you convert to advanced templates and they aren't accesible from your design tab. So to edit items  contained within these modules, you first need to create copies of the module  and update the appropriate templates to reference the copies instead of the standard TypePad ones. Then you can edit the heck out of them.

It seems more complicated than it really is. All you really need to know is the name used by the system for the module and which templates    include the module and need to be to updated once you've created it. Let's look at an example. We'll start with the entry-individual module:

The Individual Entry Module

Module Name: entry-individual

What it Does: The Individual Entry Module is used in the Individual Archives Template to generate the Permalink page for a specific post. This module includes  the post,  footer items, Technorati tags, FeedFlare, TrackBack info, the comment form, and a list of published comments. If you want to edit any of those items, you'll want to create and modify this template.

  1. Log in to TypePad and go to the Design Page for the blog you wish to edit.
  2. Click Create New Template Module at the bottom of the page.
  3. Type entry-individual into the Template Name field.
  4. Copy the following code  and paste it into the Template Body field.



  5. Click Save.
  6. Select Individual Archives from the drop-down menu labeled Select a Template to Edit: and click "go."
  7. Find the line that reads reads <$MTWeblogIncludeModule module="entry-individual"$> and replace it with <$MTInclude module="entry-individual"$>
  8. Click Save.

 

The Entry List Module

Module Name: entry-list

What it Does: The Entry List Module is used in the DateBased Archives and Category Archives Templates to generate the  posts in your archives. This module includes posts,  footer items, Technorati tags, and FeedFlare.

  1. Log in to TypePad and go to the Design Page for the blog you wish to edit.
  2. Click Create New Template Module at the bottom of the page.
  3. Type entry-list into the Template Name field.
  4. Copy the following code  and paste it into the Template Body field.


  5. Click Save.
  6. Select DateBased Archives from the drop-down menu labeled Select a Template to Edit: and click "go."
  7. Find the line that reads <$MTWeblogIncludeModule module="entry-list"$> and replace it with <$MTInclude module="entry-list"$>
  8. Click Save.
  9. Select Category Archives from the drop-down menu labeled Select a Template to Edit: and click "go."
  10. Find the line that reads <$MTWeblogIncludeModule module="entry-list"$> and replace it with <$MTInclude module="entry-list"$>
  11. Click Save.

The Entry List Sticky Module

Module Name: entry-list-sticky

What it Does: The Entry List Sticky Module is used in the Main Index Template to generate the list of posts  on the index page of your blog. If you have a featured post, this module displays the post at the top of the page, which is the main difference between this module and the Entry List module. This module includes  posts,  date and time, footer items, Technorati tags, and FeedFlare.

  1. Log in to TypePad and go to the Design Page for the blog you wish to edit.
  2. Click Create New Template Module at the bottom of the page.
  3. Type entry-list-sticky into the Template Name field.
  4. Copy the following code  and paste it into the Template Body field.


  5. Click Save.
  6. Select Main Index Template from the drop-down menu labeled Select a Template to Edit: and click "go."
  7. Find the line that reads reads <$MTWeblogIncludeModule module="entry-list-sticky"$> and replace it with <$MTInclude module="entry-list-sticky"$>
  8. Click Save.
  9. IMPORTANT NOTE: The Entry List Sticky Module is a little trickier to edit than some modules because it contains two full sets of code… one for the sticky post and one for the rest of the posts displayed on your blog's main page. When editing this module, be sure that you are editing the appropriate portion.

More Like This: Advanced Templates

Tags: , , , , , ,

Comments

enrico says:

One thing I noticed about the entry-list-sticky code you have.. Once you use that code, the post titles are no longer hyperlinks. Not sure why that happens.

Noelle says:

I want to put a 'sticky post' at the top of EACH category. Not just the front page of the blog. Anyone--- help! :-)
Thanks! Noelle

Dave Weiss says:

Interesting, Noelle.

I don't think there is a way to do this. At first, I thought you might be able to edit the Category template and and swap out the entry list for the entry sticky.

But then you'd have all your sticky posts showing up in your main index template as well as your category template, which I don't think you'd want. You'd only want sticky posts in the category only.

You could edit your Main Index template and swap out the entry sticky for the entry list. That might fix that problem, but then you could never feature a sticky post on your Main Index.

Give it a shot and see what happens. I can't tell you with 100% certainty that this would work.

Back up your design first by making a copy so that you can easily go back to something that works if the changes don't produce the desired results.

Let us know what the results are.

Noelle says:

Hi David! I thought maybe this was the hack for what I wanted listed here at TypePad Hacks-
http://hackstore.typepadhacks.org/2008/04/dynamically-gen.html
But when I go to the sample, I am not seeing.
If you go here now to some of my columns- you will see I have set up the pic and description tonight for some of the columns. NOW- I need to get it where that description and pic, STAYS there at the top! And then when the author posts in her column, her newest post will always appear right under that description. Is there any way???

http://www.takerootandwrite.com/columns_grieving_forward_your_toolbox_for_grieving/index.html

http://www.takerootandwrite.com/columns_a_time_of_worship/index.html

Thank you so much! Noelle

Andy says:

I don't see the 'Create New Template Module' is this dependant on the level of typepad account I have. I have a pro account.

Dave Weiss says:

It should be at the top of the bottom-most section of the design screen. This is only on a design that uses Advanced Templates. If you are not working with an Advanced Template design, you won't see it.

Darla says:

I've created the entry-list module, but I don't have the <$MTWeblogIncludeModule module="entry-list"$> string in either my Category or DataBased Archives.

Dave Weiss says:

@Darla:

Post the code from your template here in the comments. I'm curious to see what it looks like if you don't have that line of code in your template.

The only time I've seen templates that are super different from what John posted above is for really old blogs that preceded the current, modular designs. The old blogs all used table-based templates to lay out the pages.

sjeffh says:

I also noticed that something here stops the post titles from linking to the posts. This might be an issue if you use excerpts often as I do. Any suggestions?

The comments to this entry are closed.

TrackBack

TrackBack URL for this entry:
https://www.typepad.com/services/trackback/6a00d8341c4fdf53ef00d834547ad769e2

Listed below are links to weblogs that reference 3 Custom Template Modules You'll Use Again and Again:

typepad hacks is a typepad featured weblog typepad hacks is listed on Alltop social media

Subscribe

Email RSS Comments  
Subscribe to TypePad Hacks with email Read TypePad Hacks posts via RSS Join the conversation at TypePad Hacks via RSS (comments feed) subscriber count

Search

Socialize

Twitter Logo
    follow typepadhacks on twitter

    Read and reply to the 100 most recent comments at the TypePad Hacks Community Page


    Grazr

    Colophon

    Powered by TypePad
    Member since 03/2005

    TypePad Status

    Creative Commons License