Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
First Comment Preview Not Working
I’m running TXP 4.0.3 with no comment plugins, comments are set in admin prefs NOT to automatically append, and my comment form tags are the same as the default comment form for 4.0.3 (only some div and table stlying differences).
When I add the first comment to a post that has no comments — the comment does not show up in preview (i.e. – above the comment form above the post). The comment form is there (above the post) and the preview and submit buttons are there – just no actual preview. In addition, if I click on “preview” again — it still does not show up.
When I click “submit,” the comment shows up below the post with the thank you message as it should.
All subsequent comment previews work correctly (above the form after clicking preview).
Am I the only person with this problem? Wondering what the cause is….
Offline
Re: First Comment Preview Not Working
Please enable debug-mode and give us a link to your site. Or alternatively let us know the forms and pages you are using.
Offline
Re: First Comment Preview Not Working
Ok…. here is the code:
Page code:
<code><txp:output_form form=“head” />
<txp:output_form form=“header”/> <div id=“content_column”>
<div id=“content_box”>
<txp:ign_if_not_logged_in>
<txp:output_form form=“join” />
</txp:ign_if_not_logged_in>
<txp:ign_if_logged_in><txp:ign_password_protect>
<div id=“content” class=“narrow”>
<txp:article form=“blog” limit=“1” />
</div>
<div id=“submenu_column”> <div class=“Box”> <h3>Recent Posts:</h3>
<div class=“BoxBody”> <ul> <txp:if_article_list><txp:article_custom section=“blog” offset=“1” limit=“5” form=“title_list” /><txp:else /><txp:article_custom section=“blog” limit=“5” form=“title_list” /></txp:if_article_list> </ul> </div>
<div class=“BoxFooter”>
<p></p>
</div>
</div>
</div>
</txp:ign_password_protect></txp:ign_if_logged_in>
</div>
<br clear=“all” />
</div>
<!— end container —></div>
<!— end wrapper —>
<txp:output_form form=“footer”/></code>
comments form:
<code><div class=“comment_box”><txp:message /><br />
<small>— <txp:comment_name />    <txp:comment_time />    <txp:comment_permlink>#</txp:comment_permlink></small></div></code>
comments_display form:
<code><txp:if_comments>
Comments:<br />
<txp:comments />
</txp:if_comments>
<txp:if_comments_allowed>
<txp:comments_form />
<txp:else />
<p><txp:text item=“comments_closed” /></p>
</txp:if_comments_allowed></code>
comments_form:
<code><txp:if_comments_allowed>
<txp:if_comments_error>
<txp:comments_error class=“comments_error” break=“br” wraptag=“div” />
</txp:if_comments_error>
<div id=“comment_form_container”>
<table class=“commenttable” cellpadding=“0” cellspacing=“0” border=“0”>
<tr>
<td class=“comment_heading” colspan=“4”>
Enter a comment:
</td>
</tr>
<tr>
<td class=“column1”>
<label for=“name”><txp:text item=”*Name” /></label>
</td>
<td valign=“top” colspan=“3”>
<txp:comment_name_input />
</td>
<td valign=“top” align=“left”>
<txp:comment_remember />
</td>
</tr>
<tr>
<td class=“column1”>
<label for=“email”><txp:text item=”*Email” /></label>
</td>
<td valign=“top” colspan=“3”>
<txp:comment_email_input />
</td>
</tr>
<tr>
<td class=“column1”>
<label for=“web”>http://</label>
</td>
<td valign=“top” colspan=“3”>
<txp:comment_web_input />
</td>
</tr>
<tr>
<td valign=“top” class=“column1”>
<label for=“message”><txp:text item=“message” /></label>
</td>
<td valign=“top” colspan=“3”>
<txp:comment_message_input />
</td>
</tr>
<tr>
<td align=“right” valign=“top”></td>
<td valign=“top” align=“left”>
<txp:comments_help />
</td>
<td align=“right” valign=“top”>
<txp:comment_preview />
<txp:comment_submit />
</td>
</tr>
</table>
</div></txp:if_comments_allowed></code>
If this does not help, then I will set to debug and send a link. Thanks!
Offline
Re: First Comment Preview Not Working
The problematic part of your code is:
<txp:if_comments>
Comments:<br />
<txp:comments />
</txp:if_comments>
There’s two solutions to your problem:
Alternative 1: Keep relying on textpattern to place the preview in the correct place. In this case you have to take <txp:comments />
out of the <txp:if_comments>
confitional (i.e. switch lines 3 and 4 above). Explanation: Because that’s where Textpattern places your preview. However when there are no comments present <txp:if_comments>
returns false, and <txp:comments />
never even gets called, meaning Textpattern cannot show a preview.
Alternative 2: Use <txp:comments_preview />
in the appropiate place to show the preview in the exact place where you want it to be. Important: If you decide to use <txp:comments_preview />
you also have to “manually” place the actual comment-form by using <txp:comments_form preview="1" />
. See the weblog article for details and examples:
http://textpattern.com/weblog/127/customizing-previews-for-commenting-in-the-upcoming-402
Offline
Re: First Comment Preview Not Working
oh thanks Sencer! You’ve helped me twice in one day!
It now makes sense… I was lost as to what controlled the preview, etc.
I am now using this code and it works!:
<code>
<txp:if_comments>
Comments:<br />
</txp:if_comments>
<txp:comments />
</code>
Offline
Pages: 1