Textpattern Forum

You are not logged in. Register | Login | Help

#121 2008-02-25 22:18:09

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: [archived] sdr_guestbook

How would I create a guestbook using <txp:comments sort=“posted desc” />?? Can you provide me some steps? Also can there be another attribute for number of comments per page?


<txp:Ruhh />

Offline

#122 2008-02-25 22:30:10

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,390
Website

Re: [archived] sdr_guestbook

Well, the most important difference between regular comments and a guestbook is that in a guestbook the latest comment is on top instead of at the bottom :) So to achieve that you’d only need to adapt the comments tag for one particular article (you can create a separate article form), that can be your guestbook.
But you are right, this plugin was able to paginate comments, and that is not possible using the txp tag. You could have a look at this plugin for paginated comments.


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#123 2008-02-25 23:05:12

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: [archived] sdr_guestbook

So I create a section for the guestbook, create an article with text to be shown above the guestbook, then create a page and put the tag <txp:comments sort=“posted desc” /> in?? I am guessing the article tag and comment form tag is missing or something?


<txp:Ruhh />

Offline

#124 2008-02-26 15:57:05

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,390
Website

Re: [archived] sdr_guestbook

Well, for example, the default comments_display form looks like this:

<h2 id="<txp:text item="comment" />"><txp:comments_invite textonly="1" showalways="1" showcount="0" /></h2>

<txp:comments />

<txp:if_comments_preview>
<div id="cpreview">
<txp:comments_preview />
</div>
</txp:if_comments_preview>

<txp:if_comments_allowed>
<txp:comments_form isize="25" msgcols="45" msgrows="15" />
<txp:else />
<p><txp:text item="comments_closed" /></p>
</txp:if_comments_allowed>

You could change <txp:comments /> to:

<txp:if_article_id id="123">
<txp:comments sort="posted desc" />
<txp:else />
<txp:comments />
</txp:if_article_id>

<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#125 2008-02-26 20:11:26

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: [archived] sdr_guestbook

Uhm, I am confused. :/ Could you provide me all the steps starting from the beginning in order to make a guestbook along with the rah_comments plugin??

Last edited by Ruhh (2008-02-26 20:42:13)


<txp:Ruhh />

Offline

#126 2008-02-26 20:44:38

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,390
Website

Re: [archived] sdr_guestbook

I only tested the plugin briefly, so if this doesn’t help you, you’d better ask in the support thread for rah_comments.
At the end of your individual article form (so after title, body etc.) put something like this:

<txp:if_comments>
   <txp:if_article_id id="123"><!-- 123 is your guestbook article -->
      <txp:rah_comments wraptag="ol" break="li" limit="10" />
   <txp:else />
      <txp:comments />
   </txp:if_article_id>
</txp:if_comments>

<txp:if_comments_allowed>
   <txp:comments_form />
</txp:if_comments_allowed>

<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#127 2008-02-26 20:52:47

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: [archived] sdr_guestbook

What would the modified look like if I was to include the form for a different comment form and the styled comments?

Edit: I think I got this…

<txp:if_comments>
   <txp:if_article_id id="29"><!-- 29 is your guestbook article -->
      <txp:rah_comments wraptag="ol" break="li" limit="10" />
   <txp:else />
      <txp:comments form="questions" />
   </txp:if_article_id>
</txp:if_comments>
<txp:if_comments_allowed>
   <txp:comments_form form="ask_form" />
</txp:if_comments_allowed>

Ok, I tested it out and I get this error:

Tag error: <txp:rah_comments wraptag=“ol” break=“li” limit=“10” /> -> Notice: Undefined variable: pagination on line 71

Last edited by Ruhh (2008-02-26 21:06:53)


<txp:Ruhh />

Offline

#128 2008-02-26 21:39:54

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,390
Website

Re: [archived] sdr_guestbook

It’s just a notice. If you change production status (in Preferences) to ‘live’ it will go away :)


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#129 2008-02-26 23:19:48

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: [archived] sdr_guestbook

Oh ok. Alright well I just changed the status to Testing.

Will this tag: <txp:comments form=“questions” /> show the form I chose for the styled comments?? I do not think that tag attribute will show the different form for the comments.

Nevermind. I put the attribute in the wrong tag.

But I have a question. I use the sed comment pack plugin. How would I put a Q: before the visitor’s comment and the A: before the author’s comment??

Last edited by Ruhh (2008-02-26 23:42:33)


<txp:Ruhh />

Offline

#130 2008-02-27 00:29:52

Gocom
Developer
Registered: 2006-07-14
Posts: 4,476
Website

Re: [archived] sdr_guestbook

Yeah, <txp:rah_comments /> can output that error, but only in article list :) I haven’t yet fixed it, as the tag doesn’t even work currently in article list – only on individual article. But that is only because it uses pg as url’s get value, I could change that but then you can’t use clean urls for that by common clean url plugins. Stupid thing if you think it more :P

So, yes it notification and as I told you earlier Ruhh, it’s caused because that tag is printed in article list. It would go off if you add <txp:if_individual_article><txp:rah_comments wraptag="ol" break="li" limit="10" /></txp:if_individual_article> there ;)

Why I originally restricted the plugin to individual article? Because they are comments, but I will fix this in some point. Maybe option to use ?pg= / ?page= would be needed.


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

Board footer

Powered by FluxBB