{"id":874,"date":"2003-01-20T15:51:17","date_gmt":"2003-01-21T07:51:17","guid":{"rendered":"http:\/\/michaelhans.com\/eclecticism\/2003\/01\/20\/mt-easy-comment-and-entry-editing\/"},"modified":"2019-12-04T11:40:53","modified_gmt":"2019-12-04T19:40:53","slug":"mt-easy-comment-and-entry-editing","status":"publish","type":"post","link":"https:\/\/michaelhans.com\/eclecticism\/2003\/01\/20\/mt-easy-comment-and-entry-editing\/","title":{"rendered":"MT: Easy comment and entry editing"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:15457,&quot;href&quot;:&quot;http:\\\/\\\/davenet.userland.com\\\/2003\\\/01\\\/06\\\/firstEssayOfTheYear#theTechnologyIsHereNow&quot;,&quot;archived_href&quot;:&quot;https:\\\/\\\/web-wp.archive.org\\\/web\\\/20060811231329\\\/http:\\\/\\\/davenet.userland.com:80\\\/2003\\\/01\\\/06\\\/firstEssayOfTheYear&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-03-13 18:50:38&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-13 21:09:04&quot;,&quot;http_code&quot;:404}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-13 21:09:04&quot;,&quot;http_code&quot;:404},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:15458,&quot;href&quot;:&quot;http:\\\/\\\/www.disobey.com\\\/dnn\\\/2003\\\/01\\\/index.shtml#001451&quot;,&quot;archived_href&quot;:&quot;https:\\\/\\\/web-wp.archive.org\\\/web\\\/20080905182044\\\/http:\\\/\\\/www.disobey.com\\\/dnn\\\/2003\\\/01\\\/index.shtml&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-03-13 18:50:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-13 21:09:02&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-13 21:09:02&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:7289,&quot;href&quot;:&quot;http:\\\/\\\/www.movabletype.org&quot;,&quot;archived_href&quot;:&quot;https:\\\/\\\/web-wp.archive.org\\\/web\\\/20260306004502\\\/https:\\\/\\\/movabletype.org\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-03-09 20:10:06&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-15 05:52:16&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-24 17:25:01&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-28 03:37:19&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-31 10:45:45&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-03 16:49:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-07 00:00:33&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-10 05:19:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-13 07:08:16&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-13 07:08:16&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>Responding to Dave Winer <a href=\"http:\/\/davenet.userland.com\/2003\/01\/06\/firstEssayOfTheYear#theTechnologyIsHereNow\" title=\"First Essay of the Year\">expounding<\/a> upon the virtues of Manilla (the CMS Dave creates), Morbus offers <a href=\"http:\/\/www.disobey.com\/dnn\/2003\/01\/index.shtml#001451\" title=\"Edit this page\">this tip<\/a> for <a href=\"http:\/\/www.movabletype.org\/\" title=\"MovableType\">MovableType<\/a> users:<\/p>\n<blockquote><p>\n  The &#8220;Edit This Page&#8221; button may not be a default item in the Movable Type templates, but it is certainly possible &#8212; I&#8217;ve been using it on the individual archives of Gamegrene.com for quite a long time (it&#8217;s there, but is an invisible pixel gif at the bottom of the page). Add the following to your templates and, assuming you&#8217;re cookied into the MT adminterface, you&#8217;ve got your &#8220;Edit This Page&#8221; equivalent (broken across multiple lines for ease of reading):<\/p>\n<pre><code>&lt;a href=\"\/cgi-bin\/mt\/mt.cgi?__mode=view&amp;_type=entry&amp; blog_id=1&amp;id=&lt;MTEntryID&gt;\"&gt;Edit This Page with Movable Type&lt;\/a&gt;`\n<\/code><\/pre>\n<\/blockquote>\n<p>I use a similar technique here, only one that allows me to not have to worry about the blog ID number, and I have &#8216;edit&#8217; 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&#8217;re me (or you read this post), you&#8217;ll never know that they&#8217;re there!<\/p>\n<p>I use a combination of HTML, JavaScript, CSS, and MT tags in the &#8220;Posted by&#8230;&#8221; 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.<\/p>\n<p>First off, the code for the &#8220;edit post&#8221; links as it resides in my MT templates (all one line in the template, broken here for readability):<\/p>\n<pre><code>Post&lt;a href=\"&lt;MTCGIPath&gt;mt.cgi?__mode=view&amp;amp;_type=entry&amp;amp; id=&lt;MTEntryID&gt;&amp;amp;blog_id=&lt;MTBlogID&gt;\" target=\"_blank\" onmouseover=\u201cwindow.status=\u2019\u2019; return true;\u201d class=\u201chidelink\u201d&gt;ed&lt;\/a&gt; by &lt;MTEntryAuthor&gt;`\n<\/code><\/pre>\n<p>By using the <code>&lt;MTBlogID&gt;<\/code> MT tag rather than just typing in &#8220;<code>blog_id=X<\/code>&#8220;, we avoid any problems with having the wrong blog ID chosen if you&#8217;ve moved the code from one template to another, or don&#8217;t know the ID number of the blog you&#8217;re working with.<\/p>\n<p>The <code>onmouseover=\"window.status=\u2019\u2018; return true;\"<\/code> bit of JavaScript ensures that the status bar of the browser <em>does not<\/em> change when someone mouses over the link &#8212; 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 <code>window.status=<\/code> declaration &#8212; if you type them as double-quotes, you&#8217;ll break the code by closing out the <code>onmouseover<\/code> function too early. The&#8217;<code>return true;<\/code>&#8216; declaration is just there to ensure that the link will get passed to the browser correctly when clicked on.<\/p>\n<p>The last special bit to the tag is the <code>class=\u201chidelink\u201d<\/code> declaration. This is calling on a class I have set up in my CSS stylesheet that looks like this:<\/p>\n<pre><code>a.hidelink:link, a.hidelink:visited, a.hidelink:hover, a.hidelink:active {\n    text-decoration: none;\n    color: #7f7f4d;\n    cursor: text;\n    }\n<\/code><\/pre>\n<p>This set of CSS rules ensures that any HTML anchor with the class &#8216;hidelink&#8217; 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 &#8216;pointy&#8217; 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&#8217;ll still need to know your MT login and password to be able to make any changes).<\/p>\n<p>The same trick can be used on comments, to jump you directly to the comment editing screen. Here&#8217;s the code I used in the &#8220;Posted by&#8230;&#8221; line for comments on this site (again, as one line in the template):<\/p>\n<pre><code>On &lt;a name=\u201c&lt;$MTCommentID pad=\"1\"&amp;gt;\"&amp;gt;&amp;lt;$MTCommentDate$&amp;gt;&amp;lt;\/a&amp;gt;, &amp;lt;$MTCommentAuthorLink spam_protect=\u201d1\u201c$&amp;gt; post&amp;lt;a href=\"&amp;lt;$MTCGIPath$&amp;gt;mt.cgi?__mode=view&amp;amp;amp;_type=comment&amp;amp;amp; id=&amp;lt;$MTCommentID$&amp;gt;&amp;amp;amp;blog_id=&amp;lt;$MTBlogID$&gt;\u201d target=\"_blank\" onmouseover=\u201cwindow.status=\u2019\u2019; return true;\u201d class=\u201chidelink\u201d&gt;ed&lt;\/a&gt;:`\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I use a &#8216;edit this entry&#8217; here, only one that allows me to not have to worry about the blog ID number, and I have &#8216;edit&#8217; 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&#8217;re me (or you read this post), you&#8217;ll never know that they&#8217;re there!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2040],"tags":[812],"class_list":["post-874","post","type-post","status-publish","format-standard","hentry","category-blog","tag-movabletype"],"_links":{"self":[{"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/posts\/874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/comments?post=874"}],"version-history":[{"count":0,"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/posts\/874\/revisions"}],"wp:attachment":[{"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/media?parent=874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/categories?post=874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/tags?post=874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}