Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-05-29 21:48:13
- eoin
- Member
- Registered: 2006-03-31
- Posts: 10
Comments on static pages
Hi,
I’m trying to get comments to display on a static page.
In the txp admin area I’ve got:
Publish – Accept Comments = yes
Comments – On by default = yes
Comments – Automatically append comments to articles? = yes
For the article itself the comments are set to on.
The page template has:
<code>
<txp:article limit=1 form=“static_article”/>
<txp:output_form form=“comments_display”/>
</code>
Where static_article is:
<code>
<h3><txp:title /></h3>
<txp:body />
</code>
Where comments_display form is the txp default:
<code>
<txp:if_comments_preview>
<txp:comments />
<txp:if_comments_allowed>
<txp:comments_form />
</txp:if_comments_allowed>
</code>
The comments aren’t appearing though. I’m basically trying to create a testimonials page – for customers to leave some feedback.
Any help appreciated.
Thanks,
Eoin
Offline
Re: Comments on static pages
Hi!
You have to call the comments_display form from within an article form.
For more info about this, check this FAQ: comment display confusion.
Offline
#3 2006-05-30 00:41:28
- eoin
- Member
- Registered: 2006-03-31
- Posts: 10
Re: Comments on static pages
Hi,
I turned off “Automatically append etc. etc”
I created a form called guestbook_intro of type article with the following in it:
<code>
<h3><txp:title /></h3>
<txp:body />
<txp:comments />
<txp:comments_form />
</code>
This was then included in a page as:
<code>
<txp:article limit=1 form=“guestbook_intro”/>
</code>
It’s progress – I get the comments form. But it’s got no submit button (the comments_form is the txp default and has the markup for it). When I press the preview button I the form disappears and no preview appears in its place.
I thought that trying to view the comments to an article when viewing the page
as http://sitename/Testimonials was a loser – so I put back the permlink to the article :
<code>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<txp:body />
<txp:comments />
<txp:comments_form />
</code>
Then clicked on the permlink. Slightly better behaviour – the form doesn’t disappear when I click on the preview button. It just goes to the top of the page – above the article text. Still no submit button. No sign of any comments in the txp mysql database.
A bit stumped and must sleep now!
Eoin
Offline
#4 2006-05-30 03:36:03
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Comments on static pages
There’s several mistakes through here. I’m not sure what you’re using now, so I’ll just comment on these.
<txp:output_form form="comments_display"/>
If you have comment auto-append turned on, then you don’t use that. The contents of comments_display are then automatically added to the end of your article.
If you want comment auto-append off, then you can do the following:
<txp:if_individual_article>
<txp:article limit="1" />
<txp:article limit="1" form="comments_display" />
</txp:if_individual_article>
Next, your contents of comments display are incorrect. You had:
Where comments_display form is the txp default:
<txp:if_comments_preview>
<txp:comments />
<txp:if_comments_allowed>
<txp:comments_form />
</txp:if_comments_allowed>
Which means both your comments and your comment form would only show up during a comment preview.
Offline
Pages: 1