MT: Easy comment and entry editing

Responding to Dave Winer expounding upon the virtues of Manilla (the CMS Dave creates), Morbus offers this tip for MovableType users:

The “Edit This Page” button may not be a default item in the Movable Type templates, but it is certainly possible — I’ve been using it on the individual archives of Gamegrene.com for quite a long time (it’s there, but is an invisible pixel gif at the bottom of the page). Add the following to your templates and, assuming you’re cookied into the MT adminterface, you’ve got your “Edit This Page” equivalent (broken across multiple lines for ease of reading):

<a href="/cgi-bin/mt/mt.cgi?__mode=view&_type=entry& blog_id=1&id=<MTEntryID>">Edit This Page with Movable Type</a>`

I use a similar technique here, only one that allows me to not have to worry about the blog ID number, and I have ‘edit’ links both for each individual entry, and for any comments that are left on my site. As a bonus, the edit links are hidden, so unless you’re me (or you read this post), you’ll never know that they’re there!

I use a combination of HTML, JavaScript, CSS, and MT tags in the “Posted by…” link on every post and comment to allow me to jump directly into editing mode if I need (either due to a typo or revision on my part, or to clean up or delete any unneccessary comments left by visitors), yet keep it hidden from casual prying eyes.

First off, the code for the “edit post” links as it resides in my MT templates (all one line in the template, broken here for readability):

Post<a href="<MTCGIPath>mt.cgi?__mode=view&amp;_type=entry&amp; id=<MTEntryID>&amp;blog_id=<MTBlogID>" target="_blank" onmouseover=“window.status=’’; return true;” class=“hidelink”>ed</a> by <MTEntryAuthor>`

By using the <MTBlogID> MT tag rather than just typing in “blog_id=X“, we avoid any problems with having the wrong blog ID chosen if you’ve moved the code from one template to another, or don’t know the ID number of the blog you’re working with.

The onmouseover="window.status=’‘; return true;" bit of JavaScript ensures that the status bar of the browser does not change when someone mouses over the link — one of the visual clues to the existence of a hyperlink. Note that there are actually two single quotation marks with nothing between them after the window.status= declaration — if you type them as double-quotes, you’ll break the code by closing out the onmouseover function too early. The’return true;‘ declaration is just there to ensure that the link will get passed to the browser correctly when clicked on.

The last special bit to the tag is the class=“hidelink” declaration. This is calling on a class I have set up in my CSS stylesheet that looks like this:

a.hidelink:link, a.hidelink:visited, a.hidelink:hover, a.hidelink:active {
    text-decoration: none;
    color: #7f7f4d;
    cursor: text;
    }

This set of CSS rules ensures that any HTML anchor with the class ‘hidelink’ will have no text decoration (under- or over-lining or anything else), will be the same color as the surrounding text, and the cursor will not change to the standard ‘pointy’ cursor as it moves over the link. Between this CSS and the JavaScript code in the link, the end result is a working, active link that is entirely hidden from most browsers (and even if someone does find the link, they’ll still need to know your MT login and password to be able to make any changes).

The same trick can be used on comments, to jump you directly to the comment editing screen. Here’s the code I used in the “Posted by…” line for comments on this site (again, as one line in the template):

On <a name=“<$MTCommentID pad="1"&gt;"&gt;&lt;$MTCommentDate$&gt;&lt;/a&gt;, &lt;$MTCommentAuthorLink spam_protect=”1“$&gt; post&lt;a href="&lt;$MTCGIPath$&gt;mt.cgi?__mode=view&amp;amp;_type=comment&amp;amp; id=&lt;$MTCommentID$&gt;&amp;amp;blog_id=&lt;$MTBlogID$>” target="_blank" onmouseover=“window.status=’’; return true;” class=“hidelink”>ed</a>:`

More color/code tweaking

I’m getting closer to settling down with my design fidgeting again. For a bit, at least. I’m pretty happy with the blue-tone scheme I’ve got right now.

I’ve also managed to get the hide/show smileys function when leaving comments working, thanks to a new Scriptygoddess script (that I even helped debug — go me!), and I think (though feel free to correct me on this) that I’ve got the ‘Remember Me’ function when leaving comments fixed too. Just so all five (actually, I might be up to eight!) of my regular visitors won’t have to keep entering their information into the form. ;)

Getting pissy…

Grrrrrr!

Would everyone mind too terribly switching over to web browsers that actually support CSS layout declarations properly? Mozilla, Netscape, Chimera, whatever.

I’m working on redesigning WudiVisions, my photoblog. I’ve got the basic concept for the main page right how I want it, save a little bit of tweaking on the fonts…

…as long as you’re viewing it in a browser that has some idea how to render things correctly, at least. Notably absent from this list is Internet Explorer, Opera, Safari — dammit, pretty much any browser that doesn’t use the Gecko layout engine.

Not sure where I want to go from here. I like the concept I’ve been working with, dammit, and don’t really want to have to find something else. So for the moment, I’m just going to stomp around, whine, bitch, and moan for a few minutes. Maybe I’ll feel better after a good tempertantrum.

Colors aren't my strongpoint

I’m experimenting with different colorschemes for the site. On the bright side, this is very easy to do — just a few changes in the CSS for the site and the whole thing changes.

On the downside, colors outside of black and white just aren’t my strong suit. ;) So this may go on for the next few days until I find something I settle on. Bear with me…

Switch to MySQL

After struggling with things for a few hours tonight, I’ve managed to succesfully convert the database backend for MovableType to MySQL.

What does this mean? Well…good question. For you, the end-user, not much, though as MySQL is supposed to be a bit faster, posting comments might be a bit more responsive than it was before. For me as the author/administrator, it should mean a bit more speed when creating/editing entries, and a lot more options as far as what I can do on a design/implementation level.

At least, that’s the theory. If nothing else, according to one of the moderators of the MovableType Support Forums, “If you have the choice, pick mysql. :) A little faster, more stable, easy to browse the database….” Good enough for me!

BlogFodder

Here’s an interesting idea — BlogFodder, a daily e-mail with a short snippet of text intended to (hopefully) inspire musings, thoughts, and possibly future weblog posts. Meg’s likening it to the old school exercises where a class was given a single topic or title and ended up creating umpteen different stories seems right on target. Worth keeping an eye on, at least.

Installing MT on OS X

While searching around for pointers on getting MovableType moved over to a MySQL backend rather than the DBD backend I’m currently using, I ran across a few good general resources for OS X MovableType installations.

There’s probably more out there, but these are a good start.

Comment preview upgrade

Hooray for people smarter than me! Or, at the very least, more knowledgable of all sorts of javascripty goodness and magic.

A couple days ago, Phillip found my ‘Live Comment Preview‘ and incorporated it into his blog. However, not satisfied with what I had, he improved the code so that it recognizes and inserts linebreaks correctly!

So, I’ve gone and snagged the improvement, and tossed it into the script on my site. Better and better all the time…thanks Phillip!

GeoURL

I’ve just signed on with GeoURL, a web service that ties a weblog to a location, so that you can find out who your blogging neighbors are in a true geographic sense. For a quick example, to see who’s close to me, just check GeoURL. Just another fun toy to play with.

(Found via Jeremy)

A call for help!

I’m using a fairly heavily adapted version of the Hide/Show Comments hack from Scriptygoddess to hide and show the clickable smileys I’ve added to my site. I simplified the javascript a lot, but in doing so, the ‘hide/show smileys’ links on any post in my blog only work under Internet Explorer, and fail in various ways in any other browser (Netscape/Mozilla/Chimera don’t seem to be recognizing the javascript, and just reload the page, and Safari (and therefore probably also Konqueror, since they both use the kHTML rendering engine) doesn’t even display the links!).

Could anyone possibly give me some help on getting these to at least work under both IE and Netscape/Mozilla/Chimera, if not Safari also? I don’t know enough about javascript to know how to fix this!

(This plea has also been posted on the MovableType support forum.)

Read more