a clever workaround
For some reason, there seems to be a bug with dynamically-generated individual entry archives (using that method, rather than the dynamic publishing support in 3.1), in that the <MTEntryIfAllowComments>, <MTEntryIfCommentsOpen>, and <MTEntryIfAllowPings> tags don't seem to work - it doesn't seem like the correct status information is being pulled from the database. Thus, if you want to hide your comment posting form or link when comments are closed, this won't work on the dynamic individual archive pages. It will show even if the comments are closed or off.
Rather belatedly, I found a work around for this, using the Compare plugin and an obscure standard template tag <$MTEntryFlag$> which is mostly used for creating export files, to indicate what the comment and ping status is.
What I did is to make the following replacements:
For <MTEntryIfAllowComments> use <MTIfNotEqual a="[MTEntryFlag flag='allow_comments']" b="0">
For <MTEntryIfCommentsOpen> use <MTIfEqual a="[MTEntryFlag flag='allow_comments']" b="1">
For <MTEntryIfAllowPings> use <MTIfEqual a="[MTEntryFlag flag='allow_pings']" b="1">
There are three comment status flags. 0 means that comments are set to None, 1 means that comments are set to Open, and 2 means that comments are set to Closed. The first replacement checks whether the comment status is not set to 0, that is, whether it's set to 1 or 2. Either 1 or 2 means that comments are allowed, so that's how this replaces <MTEntryIfAllowComments>
The second replacement checks whether the comment status is set to 1, which means that comments must be open. That's how this replaces <MTEntryIfCommentsOpen>
There are two trackback status flags. 0 means that trackbacks are set to None and 1 means that trackbacks are Open. The third replacement therefore checks to see if the trackback status is set to 1. If so, trackbacks (pings) are allowed. That's how this replaces <MTEntryIfAllowPings>
Subscribe to this blog's feed
Comments
Have you tried using the MT 3.x dynamic publishing? My quick experiment on that front was unsuccessful.
Posted by: Zack | March 22, 2005 01:05 PM
No, I haven't had time to look at that yet. At some point when I have some time I hope to do so.
The issue I was talking about here is limited to dynamic publishing on 2.661 using mt-view.cgi, which I'm using for the main blog. I actually did see the question come up at the MT support forums awhile back but otherwise I'm probably one of the few people who's actually using that method and needs this workaround
Posted by: Al-Munaqabah | March 22, 2005 02:12 PM