Composing posts offline
-
I’m pleased to anounce the birth of my very first “hack”!
::beaming::
I’d give out cigars, but I don’t want to run afoul of any no-smoking policies. Of course, it’s only a baby hack – maybe it’s not even a *real* hack as the gods of geekdom define the term… It’s more like a “how to,” since everybody would have to do their own, but still, I’m pleased…
Er… where was I? Oh, yeah. Composing posts off line. One of the reasons I chose to try out WordPress was the “feature” that lets you email posts. But I was disappointed to learn that you can’t set the category or the ping back, or track back, or whether to save or publish… you can’t do anything EXCEPT post. Besides that, if you email it you have to go through a whole other set of complications. – Setting up a secret email address, checking it from the admin panel or setting up a chron job… it all seemed like too much work to me.
So I figured out how to create a local copy of the post form that lets you do everything you can do on the web version (set the category, ping status, etc). When you click one of the processing buttons (draft, private, publish or advanced edit) it behaves just like the web version – that is, it connects to the database and enters the information.
I like this because I can save the post on my hard drive until I’m ready to publish it. And I can save multiple “posts in progress” and find them easily. Plus, in the shared-server environment of my web host, unnecessary connections to the database are frowned on, and using the “draft” option and making a number of revisions – while probably not *that* much of an extra load, is an unnecessary load.
So, here’s how.
Go to your post page and hit “view source” (this is in the “view” menu in most browsers, but some have it in the edit menu, I believe).
Save the source as an html file, and I’d suggest using a different name. (I oh-so-creatively used “postform.htm”)
Copy the URL (or URI) of the web-accessed post form from your browser’s location bar.
Go down to the section of the source code that says:
<form name="post" action="post.php" method="post" id="post">
Replace “post.php” with the ENTIRE URL from your browser’s location bar (and include the quotes).
You’ll want to remove the bookmarklet at the bottom because it will cause javascript errors when the form is accessed locally (because the things can’t be found on your hard drive)… That’s the part that starts with
<div class="wrap">
<h3>WordPress bookmarklet</h3>
remove all down to the part that says
<p id="footer">(leave this in)
You’ll also either need to remove the “admin list” at the top or replace those relative links with absolute links in the same way you replaced “post.php” with the entire URL of the web version of the post form).
Save again, and you’re almost there.
If you have a local copy of all the docs for WordPress, you can just save this new form in that local copy’s “wp-admin” folder. If you want to make a separate folder (which I did, so it’s easier to find my PIP’s – and hey, the folder is CALLED “PIPs!) you need to add copies of the files the post form wants to “call” in order to display properly. those files are:
wp-admin.css
quicktags.js
Optionally, you can also include the favicon, or just delete that link from the header.
<link rel="shortcut icon" href="../wp-images/wp-favicon.png" />
(If you put it in the same folder, remove the “../wp-images/” part of the link.)
OK now! Open your new “postform.htm” (or whatever you called it) in your browser and bookmark it! You’re good to go! If you’re not logged in when you hit one of the processing buttons, you’ll be taken to the log in screen first, but no worries, the post you labored so mightily over will be “held” at the server until you actually get to the page, and then processed just like normal.
(NOTE: IF YOU WANT TO SAVE A POST IN PROGRESS, NAME IT SOMETHING ELSE!! Otherwise, you’ll overwrite your “postform.htm” file and will have to make a new one.)
So… If this is a really stupid hack, let me know… but be gentle. I’m a new mother, after all. <G>
The topic ‘Composing posts offline’ is closed to new replies.