I am setting up EZComments on a PN .7.6.1 install. I would like to display the number of EZComments for each News article on the main index page like I did with the standard comment module...
For that I used - - in the Xanthia template.
How do I do this for EZComments?
Eric
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- internetking created topic »password problem« 10:33 PM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Show number of EZComments on home page
-
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 13
Eric,
There was a topic on here a while back and jmvedrine provided some skeleton code for a pnRender plugin. It didn't work out of the box for me, but I was able to modify it to get it to work for my purposes with a recent CVS version of EZComments.
I posted the plugin for download. You can get it from http://www.demeusy.c…download-cid-1.html
Then, if you're using Xanthia, you can use something like the following which will result in a similar output to what you had using :
Code
<!--[nocache]--><a href="Article<!--[$info.sid]-->.html#comments">
<!--[ezcommentscount sid=$info.sid assign=nbcomments]-->
<!--[if $nbcomments eq 0]--><!--[pnml name="_COMMENTSQ"]-->
<!--[elseif $nbcomments eq 1]--><!--[ezcommentscount sid=$info.sid]--> <!--[pnml name="_COMMENT"]-->
<!--[else]--><!--[ezcommentscount sid=$info.sid]--> <!--[pnml name="_COMMENTS"]-->
<!--[/if]-->
</a>
<!--[/nocache]-->
Note: I am using shorturls, which is why I hard-coded the .html into the href tag. Not the most elegant solution, but it does the job.
Hope that helps,
-Matthew -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 13
I just noticed Mark's post that indicates that you don't really need this extra plugin, but can call the API directly from the template
Read the thread here. -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
Correct - the API call will get you the number of comments... This allows you to format the output however you want... We didn't want to force you to have something of the form 'x comments'. A couple of simple examples...
http://www.markwest.me.uk/changetheme-Gemini.phtml - in this theme i've just added the API call tag in brackets rather than having any wording around it. http://www.markwest.me.uk/Article38.phtml - here i've added some additional wording (add a string to your theme language file if required).
In the second example you'll also notice that i've completed reworked how comments are displayed using a custom template set. With this release of EZComments you have complete control over how the commenting interface looks to the user and how comments are presented.
-Mark
--
Visit My homepage and Zikula themes. -
- Rank: Team Member
- Registered: Jul 15, 2004
- Last visit: May 27, 2010
- Posts: 277
Could you please update your themes in the online-repository (CVS)?
So that we could see, how you integrate the hooks?
Would be very nice.
Thanks. -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
Herr.Vorragend
Could you please update your themes in the online-repository (CVS)?
So that we could see, how you integrate the hooks?
Would be very nice.
Thanks.
Sorry but if your post was aimed at me I don't know what you mean. My theme hasn't changed. The template set used for EZComments has however. You can create your own template set as needed.
-Mark
--
Visit My homepage and Zikula themes.
- Moderated by:
- Support
