Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-08-02 18:45:11

deronsizemore
Member
From: Kentucky
Registered: 2005-11-02
Posts: 324

trying to change the way comments_invite displays

By default the comments invite displays “Comment [1]” or whatever the amount of comments there are.

I’m wanting to change this to look like this: “2 Comments”

This is the code I’m using in my form:

<code>
<h1><txp:permlink><txp:title /></txp:permlink></h1>
<span class=“comment_time”><txp:posted /></span>
<txp:if_excerpt>
<p class=“body”><txp:excerpt /></p>
<p><span class=“continue-reading”><txp:permlink>Continue Reading</txp:permlink></span><txp:comments_count /><txp:comments_count /><txp:comments_invite showcount=“0” /></p>
<txp:else />
<p class=“body”><txp:body /></p>
<txp:comments_invite wraptag=“p” />
</txp:if_excerpt>
<br />
</code>
<br />
One thing I am also curious about is how to have it only say “Comment(s)” when there are more than one. If there are only one comment have it read “1 Comment” and if there are no comments at all, have it say something like “Write a comment on this article”

I assume it would be some kind of conditional, but I’m not good with conditionals at all…so if someone has a link or something that would be great!

Here is the site: <a href=“http://www.kentuckygolfing.com”>Kentucky Golfing</a>
Thanks,
Deron

Last edited by deronsizemore (2006-08-02 18:56:42)

Offline

#2 2006-08-03 09:19:20

TNT
Member
From: Rotterdam, Netherlands
Registered: 2006-01-06
Posts: 256
Website

Re: trying to change the way comments_invite displays

It’s not possible to have it say ’1 comment’, without the ‘s’. At least, not that I’m aware of.
- edit: I stumbled over this plugin: glx_if. So it is possible.

For the conditionals, check Textbook here. The examples helped me a lot.

Last edited by TNT (2006-08-03 09:26:06)


Prrrrrrrr

Offline

#3 2006-08-03 11:23:56

deronsizemore
Member
From: Kentucky
Registered: 2005-11-02
Posts: 324

Re: trying to change the way comments_invite displays

Ah, nice find! Thanks for those links. That shoudl at least do most of what I want.

Any ideas about why the “1” is not next to the word comments, but directly right of the word “continue reading?”

Offline

#4 2006-08-03 17:50:35

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: trying to change the way comments_invite displays

I think you could at least add a space before <txp:comments_count />, but otherwise I suppose it’s the CSS for your class ‘comments_invite’.

Offline

#5 2006-08-06 02:19:44

deronsizemore
Member
From: Kentucky
Registered: 2005-11-02
Posts: 324

Re: trying to change the way comments_invite displays

TNT wrote:

It’s not possible to have it say ’1 comment’, without the ‘s’. At least, not that I’m aware of.
- edit: I stumbled over this plugin: glx_if. So it is possible.

For the conditionals, check Textbook here. The examples helped me a lot.

Tried to use the glx plugin but keep getting a tag error when I try to implement it. At the top of the page, it tells me that the tags are not recognized. I’ve installed the plugin correctly, and I’ve made sure that I’ve got it enabled…are you getting this same thing?

Offline

#6 2006-08-06 05:44:01

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

Re: trying to change the way comments_invite displays

  1. Although I doubt this is it, check in Admin to see if plugins are enabled.
  2. Do you’re glx conditionals span more than one form, ie. You start one tag (<txp:glx_if>) in one form, but close it in another? They need to be in the same form.

Offline

#7 2006-08-06 18:03:59

deronsizemore
Member
From: Kentucky
Registered: 2005-11-02
Posts: 324

Re: trying to change the way comments_invite displays

I’m having trouble finding where I need to go to make sure plugins are enabled. I go to Admin>Plugins> and it says YES for “Active”, is that what you are talking about? I can’t find anywhere else where it says enabled or not.

And, no, the conditional I was using did not span more than two forms. It was just in the same form.

Thanks

Offline

Board footer

Powered by FluxBB