Jump to content

Custom Comment Output - Best Practice


Dave Damage
 Share

Recommended Posts

Hi folks,

I need to alter the markup of renderItems of Comments but keep all the rest. So my question is: Do I have to copy the whole folder of wire/modules/Fieldtype/FieldtypeComments and rename it to a new module? Or is there a simpler method?

Initially I thought about using a Replacement Hook but neither $comments->render nor $comments->renderitem() are hookable according to cpatain hook. And generating custom output would be my last choise since the comments have to be both voteable and threaded. 

Link to comment
Share on other sites

Threaded views can be quite simply done by recursive functions, as you can see in the renderNav function that's part of the default installation profile in pw. If that's not sufficient than you've only the option to copy the whole module or ask ryan to add the necessary hooks.

  • Like 1
Link to comment
Share on other sites

Threaded views can be quite simply done by recursive functions, as you can see in the renderNav function that's part of the default installation profile in pw. If that's not sufficient than you've only the option to copy the whole module or ask ryan to add the necessary hooks.

Thank you very much, I will give the recursive functions a try, should be sufficient...

Link to comment
Share on other sites

  • 11 months later...

To follow up on this, it would be very much appreciated if the render functions were hookable. I need microdata in the markup for the comment lists ratings. I know I could loop through the comments and output my own markup. But it would be much better if I could place this in a module and hook from there as I (and maybe others) sure could use this on other projects, too.

EDIT: I added an issue and a pull request on github.

Edited by gebeer
added info
  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...