This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Big Co. does business like it’s nobody’s business.
Posted by at | Reply
This code incorporates a workaround to a subtle quirk of Movable Type: The MTCommentDate tag acts differently inside an MTCommentEntry container tag.
Chapter 2 — Tweaking the Templates
When inside an MTCommentEntry, MTCommentDate displays the date and time of the entry. By putting it outside the container, MTCommentDate displays the date and time of the comment, as desired.
Much-improved Comment Listings There are a few annoyances in the way that Movable Type displays comments, which can be easily solved with a few minor tweaks.
Properly Named Anchors and Links to Them Named anchors are URL fragments used to point directly to a specific piece of content on a web page. Movable Type creates empty named anchors for each comment:
This way, if a #cID (where ID is the comment ID) is tacked onto the end of the URL to the individual archive page, the page will be scrolled directly to that comment, effectively creating a permalink to each comment. Unfortunately, not only is this a syntactically meaningless use of HTML (for those of you who care about such things), but nowhere in the default templates is there even a link provided to these anchors, making them useful only to people who read the HTML source. To offer proper comment permalinks, you should get rid of the empty anchor and use the id attribute on an existing tag (for example, ) related to each comment. Then, link some part of the comment to this anchor. The byline date, for example, is a generally accepted place for a permalink: Posted by at
The Faceless Author Movable Type produces a comment listing with each comment’s text listed first, followed by the author byline. If the comment is short and the byline is visible, this is not a problem. However, longer comments create a situation in which you are reading words without knowing the writer’s identity. There are few real-world situations in which you hear what is being said or read what was written before you ever discover the source, and there is no reason to create one on your weblog. To really enhance personalization of the comment, print out the comment link in parentheses next to the author’s name and link it as well.
Part I — Hacking the Perfect Installation If you want to make your visitors happy (or keep them from getting very irate), replace the spam_protect attribute with the no_email attribute to suppress e-mail addresses entirely if no URL is provided.
Redirection Is Lame Not long ago, Six Apart introduced CommentAuthorLink redirects as a defensive weapon against comment spam. By changing the CommentAuthorLink to an internal link, which then redirects the user to the actual author’s link, the Google PageRank (that is, the spammer’s raison d’être) for the spammer’s link is not increased. Unfortunately, it has been shown that spammers are completely unfazed by this, as demonstrated by their continued use of scattershot spamming even on blogs where a redirect exists. What’s more, there are three major problems with this technique: It breaks a well-accepted and relied-upon tenet of usability that you never want to obscure the target of the link in the status bar. It breaks the referrer generated by clicking on the link by disassociating it with the page on which the link is found. It violates one of the most important rules of web usability in that it completely breaks the Back button. For all of these reasons, we greatly dissuade you from using this technique; it doesn’t help in the fight against spam and hurts in many different ways. It can be turned off with the no_redirect attribute to MTCommentAuthorLink tag.
Putting It All Together The original comment listing code looks like this:
Posted by: at
Chapter 2 — Tweaking the Templates
No comments as yet. 1 Comment - Add another. comments - Add more.
<strong>Tags: hacking MovableType
Posted by at« |
« | Main | »
Posted by at
The Title of the Website - The Description Text
polls::list(‘Poll Radio Option’);posted @
Do you have an idea that you think others might be able to solve? Make a LazyWeb request by writing it on your own blog, and then sending a Trackback ping to the new url: http://URL.TO.SITE/lazywebtb.cgi
asks the Lazyweb,
Visit to lend your wisdom.
Come back later for more LazyWeb ideas, or subscribe to the RSS Feed for the last five entries.
On is asking the Lazyweb,Comments Posted at Post a comment Name: Email Address: