ZenphotoCMS Forum
"No comment" not display if there is no comment - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: "No comment" not display if there is no comment (/thread-3631.html)



"No comment" not display if there is no comment - Newzic - 2008-08-29

Hello,

with template exemple : I want not to display "no comment". But I want also, if there are one or more comments, display title "One comment" or "2 comments", etc. as a title.
(for example, the source would be: One comment, 2 comments etc.)

I take the code for comments in exemple template. It is:
``

I try to put ... only when there are comments and disable "no comment" when there is no comment.
I Write:

``

That don't work.

One idea?




"No comment" not display if there is no comment - acrylian - 2008-08-29

`




"No comment" not display if there is no comment - Newzic - 2008-08-29

Thank's. I try it (I m'not yet include at this time)

`

`
but I have message error...




"No comment" not display if there is no comment - acrylian - 2008-08-29

Of course, you have basic errors in your code. Try this:

`

`
Please try to learn the basics of php. There are lots of tutorials out there. I hope you will understand that we can't teach those here.




"No comment" not display if there is no comment - Newzic - 2008-08-29

yes, basics errors...

To finish this post, I correct it and include ... with "One comment" and "xx comments". There is nothing in the code source if there is 0 comments (no h3 balises empty).

This code is ok:

`

`
Thank you.




"No comment" not display if there is no comment - acrylian - 2008-08-29

You are welcome (in case I may have sounded a little harsh). Last note, in case translation is important for you. The gettext calls will probably not work correctly since this is not the setup the translation files are made with.