Can I use server side includes in a Movable Type post?
June 20, 2010 3:28 PM   Subscribe

Anybody know how to use server side includes in a Movable Type post? In other words, inside a specific entry rather than a template.

I can use SSI in movable type templates, but not in an entry? Sheesh. Note that my site uses html, not php (shtml, actually). I'm running MT 4.32.
posted by 2oh1 to Computers & Internet (5 answers total)
 
I can use SSI in movable type templates, but not in an entry?
Yes. Because "SSI" covers a lot of stuff besides just includes that it's a Very Good Thing you aren't normally allowed to do within content. Someone with template editing privs is inherently understood to be trusted. People with posting privs will include anyone from you as admin, to code-clueless writers, to self-registered community members who may or may not be malicious. This is the same reason the mteval modifier is generally a bad idea to use.

(I don't know what you're building but while the "it's just me" argument is of course valid if that's the case, remember that MT is also built for a lot more than that and has to take precautions.)

It's also worth bringing up another argument that SSI is specific to your current server environment in one way or another, and your content is at least theoretically supposed to be divorced from output; in a small way, the application is trying to ensure that. If you explain what it is you're trying to do, as opposed to just the method you've settled on, there might be a better way to implement it.

Anyway.
If you want to override this, try setting the SafeMode config directive to "1" in your mt-config.cgi file (It's highly unlikely to be there already; just add it in.) It's obviously not well documented—if you haven't been using MT long, get used to that—but I think it's the one you need.
But just so it's clear, this is a system-wide setting: It will apply to ALL users in ALL blogs/sites under this installation. You've been warned.
posted by Su at 4:03 PM on June 20, 2010


Response by poster: I am the only user and I have been using MovableType since... oh... version 2 in early 2004.
posted by 2oh1 at 4:08 PM on June 20, 2010


Damnit. I meant set the directive to "0"
posted by Su at 4:10 PM on June 20, 2010


Actually, I'm having more of a look at this, and on at least one install I have access to(with SafeMode at default), an include directive within content isn't causing any problem that I can immediately see. So what exactly is happening on your end? You imply it isn't working, but what, if anything is actually being rendered to the output? If the include markup is there untouched, then I'd guess it's actually a server problem. Does it work if you just do a flat file version of whatever you're outputting? (ie. remove MT from the equation altogether)
posted by Su at 4:24 PM on June 20, 2010


Response by poster: SafeMode solved it! At least, in this case!
posted by 2oh1 at 11:31 PM on June 20, 2010


« Older Pubs? Parks? Pierogis? What to do in Greenpoint...   |   Is colored newspaper ink more toxic than black? Newer »
This thread is closed to new comments.