Jump to content
Dave Damage

Custom Comment Output - Best Practice

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. 

Share this post


Link to post
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

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...