Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-08 16:44:56

hamba
Member
Registered: 2006-08-04
Posts: 22

conditions for comments

Hi

I have 3 conditions for the comments but I can’t figure out how to add the 3rd condition

This is what I’m after

<code><txp:if_section name=“article”>
show comments the normal way
<txp:else>
<txp:if_section name=“about”>
don’t show any comments, forms or comment invite for this section
<txp:else>
show only comment form for the use as an article contact form
</txp:if_section></code>

Does any body have an idea how I can do this?

Cheers
hamba

Last edited by hamba (2006-10-08 16:45:25)

Offline

#2 2006-10-08 17:16:16

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: conditions for comments

Sure. Go to Admin>Preferences>Turn “Auto append comments” to off.

<pre>
&lt;txp:if_section name=“article”&gt; &lt;txp:if_article_list&gt; We are on an article list &lt;txp:article /&gt; &lt;txp:else /&gt; We are on a single article &lt;txp:article /&gt; &lt;txp:output_form form=“comments_display” /&gt; &lt;/txp:if_article_list&gt;
&lt;/txp:if_section&gt;
&lt;txp:if_section name=“about”&gt; &lt;txp:output_form form=“contact” /&gt;
&lt;/txp:if_section>
</pre>

Use a contact form plugin too. Place that in a form called “contact,” or place it in an article itself.

Last edited by jm (2006-10-08 17:17:23)

Offline

#3 2006-10-08 18:09:02

hamba
Member
Registered: 2006-08-04
Posts: 22

Re: conditions for comments

Thanks I created two forms for what I wanted

The reason I’m using comments for article emails is so that we can track where the enquiry is comming from. I’m not aware of any contact form plugins that supply this type of function.
I still have to figure out how I can get a comment to be emailed to one centrale email address.

Offline

#4 2006-10-09 03:02:37

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

Re: conditions for comments

You’d probably be better off creating or modifying a plugin for this purpose, but I can tell you that if hacking is what you want to do (which is unsupported, obviously) comment emails are sent in textpattern/publish/comment.php, in the mail_comment() function, starting on line 481.

Offline

Board footer

Powered by FluxBB