Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-05-18 09:28:23

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

comment preview

Following the release of the Comment preview plugin and Logoleptic’s comment regarding the built-in <txp:if_comments_preview> tag I started experimenting to replicate the plugin’s functionality with the built in tags but all my efforts returned no results…
Using my localhost, this is how the comments form looks like now:

The code in question

<div id="cmntform">
<txp:if_comment_preview>
<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
//-->
</script>
<div class="cmntpreview"> 
<h1>Hi <txp:php>echo pcs('name');</txp:php></h1>
<p>This is what you wrote:</p>
<div class="previewtext">
<txp:comments_error wraptag="ul" break="li" />
<txp:comments_preview wraptag="p" />
</div> 
<label><txp:comment_submit /></label> 
<br />
<p>To make changes, please click <a href="#cmntform">edit</a></p> 
<p style="text-align:right"><a href="#" onclick="toggle_visibility('cmntform');">Close</a></p>
</div> 
</txp:if_comment_preview>
</div>

This should be ok… me thinks

<div style="margin-left:210px;">
<fieldset>
<div class="l"><label class="r">Comment:</label></div>
<div class="i"><label class="r"><txp:comment_message_input /></label></div>

<div class="l"><label class="n">name:</label></div>
<div class="i"><label class="n"><txp:comment_name_input /></label></div>

<div class="l"><label class="r">e-mail (optional):</label></div>
<div class="i"><label class="r"><txp:comment_email_input /></label></div>


<div class="l"><label class="n">website:</label></div>
<div class="i"><label class="n"><txp:comment_web_input /></label><txp:comment_remember /></div>


<div class="i">
<label class="n"><txp:comment_preview /></label>
<label class="n"><txp:comment_submit /></label>
</div>
</fieldset>
</div><div style="clear:both"></div>

can anyone spot what am I doing wrong?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2007-05-19 14:28:19

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: comment preview

anyone?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2007-05-19 14:39:42

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: comment preview

I’m a little rusty on the quite complex commenting system…

Try search the forum (if it hasn’t been buried in the archives), there was several in depth good tutorial on the new take on the comments.

Offline

#4 2007-05-20 01:57:42

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: comment preview

You have a typo: your code is using if_comment_preview rather than if_comments_preview.

Offline

#5 2007-05-20 05:44:27

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: comment preview

mary… how could you spot that?
Thank you thank you thank you


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB