Dave Damage Posted August 31, 2015 Share Posted August 31, 2015 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 More sharing options...
LostKobrakai Posted August 31, 2015 Share Posted August 31, 2015 How about the "Optional: Generating your own output" variant outlined here: http://processwire.com/api/fieldtypes/comments/? 1 Link to comment Share on other sites More sharing options...
Dave Damage Posted August 31, 2015 Author Share Posted August 31, 2015 How about the "Optional: Generating your own output" variant outlined here: http://processwire.com/api/fieldtypes/comments/? This was my initial approach, but especially threaded comments are a little bit more complicated and I would like to use the renderList-Method for them. So as I said, it would be my last choice. Link to comment Share on other sites More sharing options...
LostKobrakai Posted August 31, 2015 Share Posted August 31, 2015 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. 1 Link to comment Share on other sites More sharing options...
Dave Damage Posted August 31, 2015 Author Share Posted August 31, 2015 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 More sharing options...
gebeer Posted August 3, 2016 Share Posted August 3, 2016 (edited) 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 August 3, 2016 by gebeer added info 3 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now