tips and tricks for movable type
include files in comments templates
October 05, 2002
I use lots of include statements in my files (once with SSI, now with PHP) - but the one place those don't work is in Comments Listing Templates, because those pages are generated dynamically by MT.
Kevin Shay pointed out in this MT support forum thread that you can use <MTInclude> to achieve the same effect:
<MTInclude file="/www/mysite/ssi/header.txt">
I use MTInclude often to include Template Modules, but completely forgot about using it to include a file. Thanks for the reminder, Kevin!
Comments
I understand what you are saying, but could you give a practical example when this would be usefull? I mean, you could just simply put the text of header.txt in the template?
(I'm a little slow in understanding, sorry...)
Lawrence
Yes, of course you could.
The point of storing headers and footers and such in external files is that you can use them across your site and only have to edit them in one place if you decide to change them.
You have no idea how many of my site pages are pieced together from other snippits stored in separate files. In fact, I'm using another MT blog to manage all those pieces. =)
Thanks for the reminder! This also makes it possible to skin your popups in the same way that you can skin your site pages so that they match the various skins :)
(I got tired of popups, though, and am using the MySQL database to pull the info straight into my Individual archive page for the trackback stuff!!)
Oh, yeah, K? Care to share, now that I've got the *power*? Hehe.
I'm emailing you with some code ;) Cuz ya know I love sharing the power with YOU :D
Yeehaw!! =)
I'm beginning to feel like Tim Taylor on Tool Time: "MORE POWER!!"
Yay! Thanks for the tip. It helped me solve a problem with my new archives not using SSI after importing my old archives.
Woo!
Thank you thank you thank you.
I got to this page through a google search on php and MT, and was just about to do a bunch of php stuff when I saw your "MT include file" stuff. Saved me hours of work.
Thanks,
It's ALIIIIIIIVE! Rise my creation and live!
WOW. Awesome. Big thanks.