apeisa Posted March 7, 2013 Share Posted March 7, 2013 I have multiple blogs on site with different authors. I would like to use same comment field, but change the notificationEmail based on which blog got the comment. Should this https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Fieldtype/FieldtypeComments/FieldtypeComments.module#L239 be hookable or is there other way to implement this? Link to comment Share on other sites More sharing options...
Pete Posted March 7, 2013 Share Posted March 7, 2013 I think that a config option in the core module might make sense here, and I don't usually suggest that but in this case I see it just being a checkbox labelled "email post author when new comments are made" which seems a but much having a whole module for it. In this case it would work for one blog with multiple authors or multiple blogs as well. To be honest, you'd then want another one to toggle whether the admin email address gets an email with every comment as well as this might then be unnecessary on some sites. The more I think about it the more options I want to add to the config but then we're getting away from a simple config option 1 Link to comment Share on other sites More sharing options...
apeisa Posted March 7, 2013 Author Share Posted March 7, 2013 Pete: thanks. But how would that config option work? I mean all my blogs use same templates. Only thing different is path. Pretty hard to define on setting field. Link to comment Share on other sites More sharing options...
Pete Posted March 7, 2013 Share Posted March 7, 2013 I was assuming each author has their own account and therefore they would receive those emails instead of/as well as the system admin - I might not be understanding your setup well enough though. In fact, it's not as simple as I thought as individual authors couldn't moderate just their own comments with the module (assuming you wanted to?) unless you rewrite a chunk of the module and let them have access to the comments manager. Well that just got more complicated Link to comment Share on other sites More sharing options...
ryan Posted March 8, 2013 Share Posted March 8, 2013 Antti, I think you should be able to just set that email field before you output your comments. I don't think you'd need any modules or hooks or anything like that. So lets say you had a field on your page called comments_email. You may be able to do something like this: if($page->comments_email) { $commentsField = $fields->get('comments'); $commentsField->notificationEmail = $page->comments_email; } echo $page->comments->render(); echo $page->comments->renderForm(); 5 Link to comment Share on other sites More sharing options...
apeisa Posted March 8, 2013 Author Share Posted March 8, 2013 Even after two years of PW-development I seem to make things much more complicated than they are (same goes for you Petey-boy ). Thanks Ryan! 3 Link to comment Share on other sites More sharing options...
Wanze Posted March 9, 2013 Share Posted March 9, 2013 Even after two years of PW-development I seem to make things much more complicated than they are (same goes for you Petey-boy ). Thanks Ryan! LOL 1 Link to comment Share on other sites More sharing options...
Soma Posted March 9, 2013 Share Posted March 9, 2013 And even after 2 years PW you think you knew everything you discover something new. 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