Does you web presence lack style?

The definition of Swank is: Imposingly fashionable or elegant; grand. It is our desire to offer you elegant and affordable solutions for your blog or website. Take a look around and let us know what we can do to take your site to perfection.

Adding ShareThis plugin to Advanced Typepad Templates

May 6, 2008 | Filed under: Tutorials

After looking for some answers and being very unsatisfied with the amount of information out there, I decided to share this.

What you need

1. You’ll need advanced template access in Typepad.
2. A Share This script for your registered blog.
3. Some HTML knowledge.

Basics

The Typepad foundation uses Moveable Type tags. You’ll see a tag called < MT Entries > that surrounds your posts. These tags are what list the posts on the page. There is an tag to close the post area. You’ll need to use these tags to place the ShareThis script in each post.

If you look in your Main Index Advanced Template, you will see a tag < $MTWeblogIncludeModule module=”entry-list-sticky”$ >. This is where your < MT Entries > ……. < /MT Entries > tag actually lives on the front page. In other pages (Individual, Date Archive, etc) we’ll be modifying a similar, but slightly different, entry list module. So it’s not going to be as obvious about where to place the script. We’ll need to do a teeny tiny hack to get it to display at each post.

The Hack

1. Log in to your Advanced Templates and choose your current design. Feel free to create a backup copy of your current design and mess with that one. This has saved me several (hundred) times.

2. Go to the Create New Template Module. Name it something helpful and obvious. We’ll be making two new modules, one for the main index page and one for the individual entry pages. I’m naming my main page module entry-list-addthis-main.

3. Open a new tab (or window) and copy the Featured Post code.

4. Paste your code in to the new entry-list-addthis-main module.

5. Copy your Addthis Script and place it just below the < p class=”entry-footer-info” > < $MTEntryPostFooter$ > Tag.

6. Publish your template.

7. Open your Main Index Template and look for the original < $MTWeblogIncludeModule module=”entry-list-sticky”$ > and replace it with < $MTInclude module=”entry-list-addthis-main”$ > (be sure to put the name of your main module if you chose a different name! And there shouldn’t be any spaced in the tags.)

8. Save and Publish your templates.

(As an aside…. Feel free to place < p > tags (no spaces) around the script if you want it on its own line like this..)

Individual Archive Pages

Only slightly different since we’ll be using the Individual Entries tag, you’ll create another module (I called mine entry-lists-individual. Such Genius.) Copy and Paste the code from the individual entries tag in to the template. Place your script in the same location (under the < div class=”entry-footer” > < MTIfNonEmpty tag=”MTEntryPostFooter” > < p class=”entry-footer-info” > tags) placing a < br / > between them if you’d prefer. (Click Save) Go back to your Individual Archive template and replace < $MTWeblogIncludeModule module=”entry-individual”$ > with < $MTInclude module=”entry-list-individual”$ >. (Click Save)

Publish your posts.

Viola!

(Special thanks to Asha for the module tips.)

(Created and originally posted on Mrs. Flinger)

TAGS: , , , ,


RELATED POSTS:
Posted by Leslie @ 12:01 pm   

Comments

7 Responses
RSS feed for comments on this post | TrackBack this post


  1. Jeremy Says:

    Hi Leslie,

    Thanks for the great post! Your readers may also benefit from our ShareThis API (STAPI). If you could inject the code you get in this procedure into the header you can, use the SHARETHIS.addEntry code to further customize your ShareThis button. See: http://support.sharethis.com/developers for more details. I’m happy to answer any questions anyone may have about the STAPI at feedback@sharethis.com.

    Thanks again!


  2. Noelle Says:

    I could not get this to work for me! I got all the way to the…Open your Main Index Template and look for the original and replace it with
    I used the exact name as you as to not mess up- but when trying to publish this it brought up error.
    So I could not move forward.
    I want my share this back!!
    Thanks for getting this out there. Any suggestions? I did contact typepad- included your post- maybe they will use! :-)


  3. Ryan Says:

    When I make the new template module, it’s asking me to specify the output file. I put xml, but I think that’s wrong as it’s not working. Any ideas?


  4. Dave Weiss Says:

    Hey all!

    A couple of quick points to help everyone out.

    1. Make a template module for your Share This code. Call it “share-this” (shock!). Template modules are the ones at the bottom of the “Current Design” page. Copy in the code from Share This. Just use the “Share This for Other Websites” option within ShareThis.com for Publishers. Save and publish.

    2. I wouldn’t worry about putting the Share This code in the Main Index template (entry-list-sticky). The URL that will get passed to ShareThis will be the root URL of your blog, not the URL of the permalink for each post on the main page. IMHO only. Just put it on the Individual Archives template (entry-individual). Of course, if you want a ShareThis widget on the Main Index page, you can find someplace else to put it besides entry-list-sticky.

    3. Go grab the entry-individual code from the TypePad Knowledge Base, just like Leslie says. Instead of copying the ShareThis widget code into entry-individual, INCLUDE the share-this Module Template you made from point #1 above. You can use to do so.

    Now, if you need to change the Share This code and it’s in multiple places within your various templates, you only have to change the code within the “share-this” Module Template instead of going into each Index Template or Archive Template.

    Finally, one more thought - a great place to put code you want on EVERY page is in the sidebar (this is, if every page in your blog has a sidebar). So if you want “Share This” on the Main Index page as well as every Individual Archive page, About Me page, static Page pages, etc, just MTInclude the code in the sidebar.

    Hope this is helpful!


  5. Dave Weiss Says:

    Rats! WordPress stripped out my reference to . Remove the extra spaces.

    “You can use…” above does not make sense without the call to this MT directive.


  6. Dave Weiss Says:

    Nuts!

    Go look up the MTInclude tag in the TypePad Knowledge Base. It will tell you how to make pull in the “share-this” template module.


  7. Emily Says:

    Thanks for the tips Dave! I think the code you are talking about is this:

    < $MTWeblogIncludeModule module="module-name"$ >

    (Remove the spaces between the beginning and end brackets)

    You can find the info on TypePad Modules on this page


Leave a Reply


Mail (will not be published) (required)


You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


RSS


Recommended Sites



Around the Site

       Ads from Adbrite

Topics


Recommended Books

Interested in Web Design or Blogging? These are the books we recommend to get you started.

  • The IT Girl's Guide to Blogging with Moxie
  • WordPress For Dummies (For Dummies (Computer/Tech))
  • Designing with Web Standards (2nd Edition)
  • CSS Mastery: Advanced Web Standards Solutions
  • Bulletproof Web Design: Improving flexibility and protecting against worst-case scenarios with XHTML and CSS (2nd Edition) (Voices That Matter)
  • HTML, XHTML, and CSS, Sixth Edition (Visual Quickstart Guide)
  • The Zen of CSS Design: Visual Enlightenment for the Web (Voices That Matter)
  • Transcending CSS: The Fine Art of Web Design (Voices That Matter)