Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-18 01:43:58

animoller
Member
Registered: 2004-04-19
Posts: 22

How do I get the comment preview to show after the article?

I’ve searched through the forums and the FAQ and I’m still 100% confused by this. It’s probably very simple but I’m not used to working with this version of Textpattern.

I have “append comments” turned on. If I search through my comments forms I can’t see anything about #cpreview so I don’t understand how I can move it because it’s currently showing up above my article. How do I move the anchor?

Offline

#2 2006-01-18 03:39:40

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: How do I get the comment preview to show after the article?

see Sencer’s Customizing previews for commenting in the (upcoming) 4.0.2. in the weblog

set “Automatically append comments to articles?” to “no” first – then you’ll have full control

Offline

#3 2006-01-18 04:31:18

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: How do I get the comment preview to show after the article?

You know that “comments_display” form template I mentioned not too long ago? Well this is what mine looks like:-

<code><txp:if_comments_preview>
<txp:comments_preview form=“comments_preview” />
<txp:comments_form preview=“1” />
<txp:else />
<txp:if_comments>
<h3 id=“comment”><txp:comments_count /> Comments for <txp:title /></h3>
</txp:if_comments>
<txp:comments />
<txp:if_comments_allowed>
<txp:comments_form />
</txp:if_comments_allowed>
</txp:if_comments_preview></code>
<br />

So with my form the first thing it asks is are we in comment_preview mode. If yes we get the article (which isn’t referred to in the code as this is appended immediately after it) followed by the comment_preview followed by the comment_form. I don’t bother with the other comments in mine when in preview mode. I happen to use a different form for preview mode, “comments_preview”, which has the same formatting for the comment itself but above it I can place a little message to say something like “This is how your comment will look when submitted.”

If not (else) we get the article, followed by an “h3” title for the comments, but only if there are comments. You don’t need this but that “id=comment” is an anchor to the comment invite so when someone clicks the invite they come straight to the top of the comments. Then the comments themselves followed by the comment_form if comments are allowed.

So basically the comments_display form controls the overall structure of your comments page but then you need to go to each individual form for the detailed stuff.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#4 2006-01-18 10:58:45

animoller
Member
Registered: 2004-04-19
Posts: 22

Re: How do I get the comment preview to show after the article?

Okay, I really don’t get this at all. It isn’t explained in the FAQ clearly enough – unless of course you know Textpattern or coding really well – and it just doesn’t make sense to me.

I don’t understand how it does something (ie, place the preview above the article) that I can’t see in my code (ie, in the forms) and I have to do loads of changes to the forms and settings in the admin setting just to move that preview.

Offline

#5 2006-01-18 23:17:40

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: How do I get the comment preview to show after the article?

Errr. OK then. In days of old when knights were bold and bloggers feared to pop their heads above the parapet, TXP used to output the individual_article view in a fixed format. It was coded into the application and you used to get the article, followed by an “h3”, then the comments listing and the comment_form at the bottom. Now there are many people who would like to be able to place the comments listing and comment_form where it suits their layout best. Some wanted to be able to put them side-by-side, or others might want the comment_form under the article with the comments listing in the sidebar. Whatever. So the devs got to work on this but they needed some method of ensuring “backward compatibility” for those who were quite happy with what they already had so the comments_display form came into being. By automatically picking up this form (auto append) they maintained the previouse structure whilst making it possible for people to switch off “auto append” so that they could place the individual tags where they wanted them.

The bonus here is that even those of us who are quite happy with a normal type of structure can now modify the comments_display form to our own needs, including placement of the comment_preview, which gives everyone a lot of extra flexibility. The new tags and forms were discussed in the Dev Weblog which is linked to at the top of this page. It’s important enough for a “Bookmark” of it’s own.

That was long-winded and I probably haven’t answered your question. Was my example of the form useful?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#6 2006-01-18 23:44:01

animoller
Member
Registered: 2004-04-19
Posts: 22

Re: How do I get the comment preview to show after the article?

I did try to use it but I’m a total pleb and don’t understand how to fit it all together (although when I fiddled with your form in my system I kinda broke my comments. OOPS!). I did read about WHY it works how it works now and I get that – my 1.18 version has all the changes hardcoded (and what a pain that was), but the problem is that my brain doesn’t seem to understand how to convert my old hardcoded changes to the new non-hardcoded type.

So, if I use this comment_preview form like you do, I need to turn the auto append thing back off? Would it be possible for you to post your examples of the various comments forms so I can get an overall picture of the new system and how they work together? It would be much appreciated. :)

Offline

#7 2006-01-18 23:53:51

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: How do I get the comment preview to show after the article?

Keep auto append on. If it isn’t on then TXP won’t use this form and you will have to place all the individual tags yourself. As for all my other forms I don’t have a problem other than it will clog up the thread a bit so if you send me an email to stuart at thebombsite dot com I’ll send all the info over to you. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB