Frequently Asked Questions
if_comments, comments_invite changes
Q.
<txp:if_comments>is broken
<txp:comments_invite />is broken
A.
The behaviour of the <txp:if_comments>...</txp:if_comments> conditional has changed in Textpattern 4.0.2. Under normal circumstances we don’t change the existing behaviour of tags in minor releases, but in this case the old behaviour wasn’t as originally intended, and the tag was almost useless as a result.
Previously, the default template contained code like this, for displaying the comment invitation link:
<txp:if_comments><p><txp:comments_invite /></p></txp:if_comments>
In 4.0.2, the meaning of if_comments has changed from “if comments are turned on”, to “if at least one comment exists for this article”.
To achieve the same result with Textpattern 4.0.2 or higher, use the following code:
<txp:comments_invite wraptag="p" />
The default template included in 4.0.2 has been updated, so if you’re installing from scratch with 4.0.2 or higher you don’t need to change anything.
If you’re using a derivative of the default template that originated with version 4.0.1 or earlier, you’ll need to change that particular fragment of code as shown above.
Posted 27 October 2005, 00:02 by Alex Shiels
