Help - Search - Members - Calendar
Full Version: print entry template?
Movable Type Community Forum > Additional Resources > Tips and Tricks
freshyill
I'd like to offer my visitors the option to view the page they're at in a printable form...

I've heard of this being done with Movable Type on other sites, but I have no idea where to start as far as how I would link to this template.  Is this going to be easy?

thanks!
almuhajabah
I assume that you want to do this for your archive pages. I'll use Individual archives as an example but you can do this for the other archive types as well.

Go to Templates and in the archive templates area click the link to create a new template. Give it a name like "Printable Individual Archive" and paste in your desired template.

Next, go to Weblog Config | Archiving. Click the link to add a new archive type to the list. Select your "Printable Individual Archive" template and associate it with the Individual archive type.

Now you need to come up with a unique filename for it, using the archive file template field. You might do something like this:

CODE
<$MTEntryCategory dirify="1">/<$MTEntryID pad="1"$>-print.html


This will place each page in a directory named for the entry's category then give it a filename like 000100-print.html

When you're done, rebuild your site to create the new archive files.

To link to them, you will need to "handcode" the link, for instance:

CODE
<a href="<$MTBlogArchiveURL$><$MTEntryCategory dirify="1"$>/<$MTEntryID pad="1"$>-print.html">Printable version</a>
freshyill
hmm...i'm sort of getting it to work...kinda sorta...

I'm using archives in this format...

http://www.theblankeffect.com/archives/200...cle_title.shtml

CODE
<$MTArchiveDate format="%Y/%m"$>/<$MTEntryTitle dirify="1"$>-print.shtml

would be how i would set that up, right?  when i do that, i get the wrong article

this is how i have the link set up:
<a href="<$MTBlogArchiveURL$><$MTArchiveDate format="%Y/%m"$>/<$MTEntryTitle dirify="1"$>-print.shtml">Printable Version</a>


what am i doing wrong?  is it something i have on the template for printing?

all i have on there is

CODE
<MTEntries>
<$MTEntryExtended$>
</MTEntries>


should there be more?  that gives me the basic stuff, and i do plan to format it a little bit, but it's the wrong content.
almuhajabah
It looks like your template code is correct. Could you provide a link to a page that illustrates your problem?
freshyill
No problem...

http://www.theblankeffect.com/archive....e.shtml

the link to the printable version is near the bottom
girlie
QUOTE
all i have on there is

CODE
<MTEntries>
<$MTEntryExtended$>
</MTEntries>

Note: You should not have the <MTEntries> and </MTEntries> tags in an Individual Archive Template.
freshyill
Doh!  That was the error.  Good thing I said that then, I guess.  Thanks girlie for clearing that up, and thanks almuhajabah for your help too.

You guys are great.  I want to be like you when I grow up.  These forums never cease to amaze me.
almuhajabah
Good catch, girlie! I was too concentrated on finding a link to the site to notice that.

And it looks great, freshyill!!
freshyill
Thanks ;^)

Though it wouldn't be nearly as nice without the support of everyone here.
girlie
I'm glad that did the trick for you!  :)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.