kongondo Posted January 28, 2015 Share Posted January 28, 2015 Just a by the way, alternatively, with the latest addition to the core, where two modules with the same name can co-exist.....you can copy the module and make changes to the hard-coded stuff.... Link to comment Share on other sites More sharing options...
closer12 Posted February 1, 2015 Share Posted February 1, 2015 I tried paginate comments list but when i press next 404 Page Not Found error , how to solve this ? Link to comment Share on other sites More sharing options...
kongondo Posted February 1, 2015 Share Posted February 1, 2015 @closer12, did you enable pagination for the template that page uses? E.g. Admin > Setup > Templates Edit Template: basic-page in the URLs tab Link to comment Share on other sites More sharing options...
closer12 Posted February 1, 2015 Share Posted February 1, 2015 I added this code to the template , do i need to do something else? $limit = 2; // comments to display per page $start = ($input->pageNum-1) * $limit; $selector = "page=$page, sort=-created, start=$start, limit=" . ($limit+1); // find the comments. replace "comments" with the name of your comments field $comments = FieldtypeComments::findComments("comments", $selector); // output the comments echo $comments->render(); // output the pagination links if($input->pageNum > 1) echo "<a href='./page" . ($input->pageNum-1) . "'>Back</a> "; if(count($comments) > $limit) echo "<a href='./page" . ($input->pageNum+1) . "'>Next</a>"; Link to comment Share on other sites More sharing options...
kongondo Posted February 1, 2015 Share Posted February 1, 2015 Did you see my post just above yours? Link to comment Share on other sites More sharing options...
closer12 Posted February 1, 2015 Share Posted February 1, 2015 How to enable enable pagination for the template? I just added this code , do i need to enable from different place? Link to comment Share on other sites More sharing options...
kongondo Posted February 1, 2015 Share Posted February 1, 2015 Yes, see my post above. I have edited it. Note there is a difference between template and template file in ProcessWire. Where you add your code above is in the template file. What I am talking about is the template, in the admin Link to comment Share on other sites More sharing options...
closer12 Posted February 1, 2015 Share Posted February 1, 2015 thank you i solved. i am beginer on pw i didnt know this Link to comment Share on other sites More sharing options...
kongondo Posted February 1, 2015 Share Posted February 1, 2015 Cool. No worries. Link to comment Share on other sites More sharing options...
creativejay Posted February 2, 2015 Share Posted February 2, 2015 Good morning everyone. I'm having trouble with the Comments fieldtype on my site. I initially thought it was a problem with some setting on the ProcessBlog/MarkupBlog modules I'm using by Kongondo, but he suggested I try a new comment field on a non-blog page and the problem exists there, as well. I'm not sure where the problem lies, but I'll outline the symptom. When I attempt to submit a comment on a page, the form redirects me to ./#CommentForm, which loads as the root of the site (the #CommentForm appears in the URL). There is no comment posted, nothing waiting for me in the Comments Manager, etc. No error logged that I can find, just a quiet fail. Aksimet and redirect are enabled on both the field blog_comments and my newer testing field swmb_comments Does this sound like anything that anyone has run into? I'm assuming the action of './' and id of 'CommentForm' are default for a reason (as in, they *ought* to work). Appreciate any help you can provide! Link to comment Share on other sites More sharing options...
creativejay Posted February 4, 2015 Share Posted February 4, 2015 Still hoping for some help with the comments. Kongondo had suggested there might be something wrong with my setup. Should I replace the Fieldtype/FieldTypeComments/ folder in wire/modules with a fresh one from Processwire-master? Link to comment Share on other sites More sharing options...
kongondo Posted February 4, 2015 Share Posted February 4, 2015 If you can set up a new local site (or online @ lightning.pw) running on the stable version of PW (-master) without any third party modules and test your comments code on that, we can begin to troubleshoot what's wrong. Do the same but with a separate -dev version install of PW and see if you still get errors. If you get errors in both, then the problem has to be your code. We can then dissect that... Link to comment Share on other sites More sharing options...
creativejay Posted February 4, 2015 Share Posted February 4, 2015 Thanks for the approach idea kongondo! Master and Dev blank site with basic-page having a Comments field works as expected. So my template file code is okay. Link to comment Share on other sites More sharing options...
kongondo Posted February 4, 2015 Share Posted February 4, 2015 So you were able to post and approve comments on both? If so, then it must be a collision with some other code/module on your other site... Time to proceed with the troubleshooting... - the tedious bit! One by one, install the modules you have in your 'non-working' site in your new Master and Dev blank test sites....testing if comments work after each module install. What third party modules do you have, apart from Blog? It's probably an autoload module. Link to comment Share on other sites More sharing options...
creativejay Posted February 4, 2015 Share Posted February 4, 2015 (edited) What third party modules do you have, apart from Blog? It's probably an autoload module. The modules I see in ./site/modules/ are: [ deleted list of modules ] I'll start the install&test process... Edited February 5, 2015 by creativejay Link to comment Share on other sites More sharing options...
douglas81 Posted February 5, 2015 Share Posted February 5, 2015 Maybe I'm missing something obvious, but how does one go about pre-populating the input fields? Link to comment Share on other sites More sharing options...
creativejay Posted February 5, 2015 Share Posted February 5, 2015 (edited) Went through all the modules in /site/modules. LoginRedirect caused an infinite redirect loop and I couldn't get in, so I had to remove that manually. Now my admin can't locate new modules (by class name, URL, or upload) so I had to upload zip files of my existing modules to install them. Anyway, nothing caused it in the fresh install of the master. What would be the next step? I would rather not recreate my site in a clean install, but if I must... Edited February 5, 2015 by creativejay Link to comment Share on other sites More sharing options...
Zahari M. Posted February 21, 2015 Share Posted February 21, 2015 Hi Guys! Been using the new threaded comments module / system and it's working out really nicely! Currently when we set the the date / time format of our comment field to relative, it outputs things like 5 minutes ago, 5 hours ago, 5 months ago etc... I'm trying to build a single language non-English site. The question is how can we change the language that it outputs? If anyone could show me some sample code that translates these relative time descriptors to another language, I would be most grateful!! Cheers and thanks for looking! Link to comment Share on other sites More sharing options...
creativejay Posted March 10, 2015 Share Posted March 10, 2015 I sorted out my earlier problem - turned out the head of the template included a base href call that was what was pushing comment submit to the home page. It's always the little things! Now that they're working, I'd like to send notification of new comments to the creator of the page the comments are submitted on. This will be different from page-to-page, so I don't want to put everyone's emails in the field's setting for notifications. I looked in the module for a spot to append a page-based value to the email send, but I didn't see it. What I'm trying to do exactly is better described in this thread I started for this and another email-hooking question. Thanks! Link to comment Share on other sites More sharing options...
Alexander Posted April 4, 2015 Share Posted April 4, 2015 Dear all, I can't find any explanation how to change "E-Mail Notifications" from Off to Replies by default. Any ideas? I found solution from Ryan which works perfect for me. include("./MyCommentForm.php"); $form = new MyCommentForm($page, $page->comments); echo $form->render(); Link to comment Share on other sites More sharing options...
JasonS Posted July 14, 2015 Share Posted July 14, 2015 Hey Everyone, I would first like to point out that i love the new additions to the comments system. Now what brought me here... I have a problem with my reply button. When using the $page->comments->renderAll function it works beautifully, however on https://processwire.com/api/fieldtypes/comments/ it shows me how to rename the headlines for each section by doing this... <?php echo $page->comments->render(array( 'headline' => '<h2>Read Comments</h2>', )); echo $page->comments->renderForm(array( 'headline' => '<h2>Join The Discussion</h2>', )); However when I do this, my reply link in the comments section doesn't work anymore. it doesn't show me nice slide down section for entering a new comment as it did using the renderAll function. If there is a workaround or some other way of getting it to work while having both headlines text changed, it would be great. Thanks. Link to comment Share on other sites More sharing options...
alp9000 Posted July 30, 2015 Share Posted July 30, 2015 However when I do this, my reply link in the comments section doesn't work anymore. it doesn't show me nice slide down section for entering a new comment as it did using the renderAll function. If there is a workaround or some other way of getting it to work while having both headlines text changed, it would be great. Thanks. I solved this problem by adding this line to the <head> of my page: <script type='text/javascript' src="/wire/modules/Fieldtype/FieldtypeComments/comments.js"></script> But I'm not clear on whether that is the correct solution, since it isn't mentioned in any of the docs (that I can find). Link to comment Share on other sites More sharing options...
dotnetic Posted August 10, 2015 Share Posted August 10, 2015 @ryan It seems that successMessage in a custom render call has no effect. EDIT: There is a pendingMessage string, that is being used. So what is the difference between pendingMessage and successMessage? EDIT2: Understood it now. When the approval is not needed, successMessage is being used. I used echo $page->comments->renderForm(array( 'headline' => "<h3>Sag uns deine Meinung</h3>", 'successMessage' => "<p class='success'>Danke. Dein Kommentar erscheint, wenn wir ihn freigegeben haben.</p>", 'errorMessage' => "<p class='error'>Dein Kommentar konnte nicht gespeichert werden. Bitte überprüfe, ob du alle Felder korrekt ausgefüllt hast, bevor du es erneut probierst.</p>", 'processInput' => true, 'encoding' => 'UTF-8', 'attrs' => array( 'id' => 'CommentForm', 'action' => './', 'method' => 'post', 'class' => '', 'rows' => 5, 'cols' => 50, ), 'labels' => array( 'cite' => 'Dein Name', 'email' => 'Deine E-Mail', 'text' => 'Deine Meinung', 'submit' => 'Abschicken', ), // the name of a field that must be set (and have any non-blank value), typically set in Javascript to keep out spammers // to use it, YOU must set this with a <input hidden> field from your own javascript, somewhere in the form 'requireSecurityField' => '', // not used by default )); But after successful submitting the form, the message "Your comment has been submitted and will appear once approved by the moderator" appears still in english. errorMessage works fine. Link to comment Share on other sites More sharing options...
dotnetic Posted August 10, 2015 Share Posted August 10, 2015 @ryan There is a problem on mobiles after submitting the form because the page is being redirected to #CommentsForm, but the #CommentPostNote is outside of the #CommentsForm, so users on mobile don´t see it. Would be better if the success message is included in the form. Link to comment Share on other sites More sharing options...
Alexander Posted September 5, 2015 Share Posted September 5, 2015 MAYDAY MAYDAY MAYDAY Hey Everyone, I'm looking how to send notifications about comment to user that created the page. Actually, I found piece of code FieldtypeComments.module:664 $f->addOption(self::notificationCreated, $this->_('Send notifications to user that created the page')); but its commented and not working. Maybe it possible to make it like "created_user_id:email" in admin notification settings or something like that? Thanks for any help. 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