Jump to content

marie.mdna

Members
  • Posts

    43
  • Joined

  • Last visited

Posts posted by marie.mdna

  1. Hi @Juergen, I gave a look at the module, but came across a few issues (the biggest one would be that after submitting, nothing really happened?). I am testing the module locally, on Processwire 3.0.229; PHP 8.2.0. I am a wondering what could have been missed during the installation?

    • I seem to have all the module requirements
    • I've got this error during installing the module via directory "Integrity constraint violation: 1062 Duplicate entry 'fl_registerpage' for key 'name'", which didn't show after submitting the module
    • You mentioned that 10 templates and pages will be created (with those names fl_activationpage,...), no new template or page has been added to my site, could it be because of the previous error?
    • The 8 new fields for the user have been added successfully 

     

    For this basic use of $modules->get('FrontendLoginRegister')->LoginPage(); I have got an error related to the main FrontendForms module.

    $login = $modules->get('FrontendLoginRegister')->LoginPage();
    $login->setPrependBody(true);
    echo $login->render();
    
    $register = $modules->get('FrontendLoginRegister')->RegisterPage();
    $register->setPrependBody(true);
    echo $register->render();

    The corresponding error:

    Quote

    Look out… Fatal Error: Uncaught TypeError: FrontendForms\Link::setLinkText(): Argument #1 ($linktext) must be of type string, null given, called in site/modules/FrontendForms/Formelements/Textelements/Link.php on line 71 and defined in site/modules/FrontendForms/Formelements/Textelements/Link.php:55

    #0 site/modules/FrontendForms/Formelements/Textelements/Link.php (71): FrontendForms\Link->setLinkText(NULL)
    #1 site/modules/FrontendLoginRegister/pages/LoginPage.php (98): FrontendForms\Link->setPageLink(Object(NullPage))
    #2 wire/core/Wire.php (413): FrontendLoginRegister\LoginPage->___passwordForgottenLink()
    #3 wire/core/WireHooks.php (968): Wire->_callMethod('___passwordForg...', Array)
    #4 wire/core/Wire.php (484): WireHooks->runHooks(Object(FrontendLoginRegister\LoginPage), 'passwordForgott...', Array)
    #5 site/modules/FrontendLoginRegister/pages/LoginPage.php (410): Wire->__call('passwordForgott...', Array)
    #6 site/templates/og_login.php (92): FrontendLoginRegister\LoginPage->render()
    #7 wire/core/TemplateFile.php (328): require('/Users/mariemad...')
    #8 wire/core/Wire.php (413): TemplateFile->___render()
    #9 wire/core/WireHooks.php (968): Wire->_callMethod('___render', Array)
    #10 wire/core/Wire.php (484): WireHooks->runHooks(Object(TemplateFile), 'render', Array)
    #11 wire/modules/PageRender.module (574): Wire->__call('render', Array)
    #12 wire/core/Wire.php (416): PageRender->___renderPage(Object(HookEvent))
    #13 wire/core/WireHooks.php (968): Wire->_callMethod('___renderPage', Array)
    #14 wire/core/Wire.php (484): WireHooks->runHooks(Object(PageRender), 'renderPage', Array)
    #15 wire/core/WireHooks.php (1094): Wire->__call('renderPage', Array)
    #16 wire/core/Wire.php (484): WireHooks->runHooks(Object(Page), 'render', Array)
    #17 wire/modules/Process/ProcessPageView.module (184): Wire->__call('render', Array)
    #18 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage(Object(Page), Object(PagesRequest))
    #19 wire/core/Wire.php (416): ProcessPageView->___execute(true)
    #20 wire/core/WireHooks.php (968): Wire->_callMethod('___execute', Array)
    #21 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessPageView), 'execute', Array)
    #22 index.php (55): Wire->__call('execute', Array)
    #23 {main}
    thrown (line 55 of site/modules/FrontendForms/Formelements/Textelements/Link.php)

    This error message was shown because: site is in debug mode. ($config->debug = true; => site/config.php). Error has been logged.

    I would be more than happy to receive some help on how to properly install it and use it, thanks in advance !

  2. Hey ! I haven't used Padloper yet but it looks very promising, thank you for this ! I am looking forward to seeing the latest version, in the meantime, is there anywhere we could have a look at a live version (and idea of pricing?)

    @kongondo sorry for the bother, is there any way to get updated/notified about the upcoming release?

    • Like 1
  3. Hi @Juergen, first of all, thanks for the module, it seems to be a time savior !

    I now have a (probably very dumb) question, I've tried to use your code from "Create the first form" in your documentation. It worked nicely and as expected. However I left my computer and when I came back I refreshed my localhost page, got an error message mentioning that the amount of time for submitting the form had been way too long and that it could be bot behavior. My bad on this... The thing is that now I can't seem to be able to render the form anymore. Any idea on how to allow myself to keep working/discovering your module?

    Best,

  4. On 11/9/2022 at 2:39 PM, Guy Incognito said:

    It's important that this is the case too because otherwise you could potentially be informing site engines you are using a different primary domain to one your site it actually using.

    Indeed, I tried the module for the first time on a test website where I didn't care much about any SEO (so nothing had been really set for this purpose) but was then testing for upcoming projects!

  5. 1 hour ago, virtualgadjo said:

    Hi @marie.mdna

    if i'm not wrong this depends on your config file $config->httpHosts var, if the first host in the array contains the www, the sitemap will use it too (at least, that's what happens for all the websites, a lot..., for which i've this module installed ?

    have a nice day

    perfect! That's the point I got missing!

  6. Hi @Chandini, if I understand correctly, you want to redirect to a specific url after posting the comment instead of:

    http://localhost/myblogs/?comment_success=1#CommentPostNote

    To change the success redirect url I went into the CommentForm.php file from the module.
    You should find this :

    $this->wire('session')->redirect($url);

    Replace this with the url you want:

    $this->wire('session')->redirect("./#loader");

     

    And yes it is possible to get all comments into another page.

    2 hours ago, Chandini said:

    is it possible to get the all comments in a particular template? irrespective to the page associated with the template.

    I would do something similar to this, first find all pages with the template having the comments field, for each one of them get the comments field, then for each comment, if it is approved and published, retrieve the data you need (cite, url, date, text, votes, stars,...) and echo them the way you need :

    foreach($pages->find("template=yourTemplatewithComments") as $pageComment){
        foreach($pageComment->get('comments') as $comment) {
            if($comment->status < 1) continue; 
            //get what you need
            $cite = htmlentities($comment->cite);  
            $commentUrl = $comment->url;
            $date = date('m/d/y g:ia', $comment->created); // format the date
            $text = htmlentities($comment->text);
            // do something
        }
    }

    Let me know if that works for you

    • Like 1
  7. On 11/10/2017 at 8:57 AM, formmailer said:

    Hi!

     

    I tried to enable mail notification for users (guests), enabled "Allow commenter e-mail notifications":

    image.thumb.png.cb62ae107a9b8b61f782388508c088cf.png

    The option shows up on the page:

    image.png.aa32f2e187e13d962bb07159f04777fc.png

    But no e-mails are being sent. Is there something else I need to do?

    Other mail notifications, like the admin notification for comments, are working just fine, so it's not a general e-mail issue.

     

    Any help is appreciated.

     

    //Jasper

     

     

    hi @formmailer, it has been some time since your post but I have kind of the same issue except that even admin notifications aren't sent, did you find out how to deal with this?

    Note: my comments are rendered via the customList but it is in the site/modules directory already, as suggested by @Juergen and I don't need comments approval, just email notifications to the page creator, as well as to all people who commented on the page.

    I have tried those  but still didn't receive anything yet...

    Any help would be greatly appreciated!

  8. On 6/1/2018 at 4:19 PM, BitPoet said:

    Three solutions immediately spring to mind:

    a) Create different comments fields for each group of pages (downsides: you have to keep other settings in sync and page queries may have to run over both fields)

    b) If all comments pages are at the same depth (or not too deeply nested) and each has a unique (might also be grand-) parent, you can create a field on those ancestors that holds the admin contact email and use the "field:" syntax in Admin notification email:

    field:parent.adminemail
    // or, for grandchildren
    field:parent.parent.adminemail

    You could even set multiple sources this way if the adminemail might be either on the parent or the grandparent (just make sure it isn't set on both). The comments field will only use valid emails, so if a parent or grandparent doesn't have the field (or doesn't exist), that entry will be ignored.

    field:parent.adminemail,field:parent.parent.adminemail

    c) In some scenarios, you want to send notifications to the user that created the page. In that case, you can use

    field:createdUser.email

    The big downside of that approach is that when the creator of the page is no longer available to approve comments, the createdUser field has to be changed or a different email address assigned in their profile settings (and comment notifications might get lost if nobody thinks of that).

    It should also be possible to populate $field->notificationEmail through a hook, but from the top of my head, I can't name a convenient method to hook into.

    I have been trying to send email notifications but for some reason no email has ever been sent, even though I might have try all these different options I still can't get it to work.

    I am currently working on a forum and need to notify the createdUser of the page as well as all the people that commented (I've let the option to disable the notification).

    In the admin panel, under the Comments category, emails are there, and notify is set on All as it should.

    I there some settings somewhere I might have missed? Something to edit in the module itself?

  9. [edit] I found my way in, thanks again for sharing!

    Quote

     

    It looks incredible! I would love to reuse this logic but I have some problem to visualise how the templates and fields should look like from the admin panel (especially when it comes to userProfiles). For example, how could I get 2 user info pages from the same repeater field?

    On 2/20/2015 at 12:49 PM, salepg said:

    templates(fields):

    - mailbox (generate view and calls MailboxClass as controler)

    - threads (title, headline, userProfiles [FieldtypePage]),

    - messages (title, threads [FieldtypePage], msgBody, dateCreated)

    userProfiles contains 2 userinfo pages (sender and receiver) which title is equal to username

    page structure:

    - Mailbox (mailbox.php template)

    -- Threads (threads.php which purpose is only as selector)

    ---- salepg (messages.php which purpose is only as selector)

    ---- salepg-1

    ---- mr-fan

    ---- lostkobrakai

    I would be a great help to have some screenshots of how to set the fields and templates properly!

     

     

  10. Quick update! Thanks to your suggestion @Robin S, I could make it work without having to redirect to the child page.

    Here is the adjustments I came up with, I changed the action of the form to 

    action='{$post->url}?submit_a_comment=1'

    Parent page template:

    <?php
    $form = $post->comments->getCommentForm([
        'className' => 'CommentFormCustom',
    ]);
    
    
    $formMarkup = "
        <form class='{form.class} discussions_message ' id='my-comment-form' action='{$post->url}?submit_a_comment=1' method='{form.method}' {form.attrs}>
                    <div class='avatar'>";
    
    
    //        just added
    if(count($user->images)){ 
        $imgUrl = $user->images->last()->url;
    } else{ 
        $imgUrl = $user->url;
    } 
    $formMarkup .= "<img src='{$imgUrl}' data-src='{$imgUrl}'>";
    //        end
    
    $formMarkup .= "
                    </div> 
    
                    <p class='{cite.wrap.class}'>
    					<label class='{label.class}'>
    						<span class='{label.span.class}'>{cite.label}</span> 
                            <textarea name='{cite.input.name}'  class='{cite.input.class}' required='required' value='{cite.input.value}' >{cite.input.value}</textarea>
    					</label>
    				</p>
    
    				<p class='{email.wrap.class}'>
    					<label class='{label.class}'>
    						<span class='{label.span.class}'>{email.label}</span> 
                            <textarea name='{email.input.name}' class='{email.input.class}' required='required' value='{email.input.value}' >{email.input.value}</textarea>
    
    
    					</label>
    				</p>
    
    				{if.website}
    				<p class='{website.wrap.class}'>
    					<label class='{label.class}'>
    						<span class='{label.span.class}'>{website.label}</span> 
    						<input type='text' name='{website.input.name}' class='{website.input.class}' value='{website.input.value}' maxlength='255' />
    					</label>
    				</p>
    				{endif.website}
    
    				{if.stars}
    				<p class='{stars.wrap.class}' {stars.wrap.attrs}>
    					<label class='{label.class}'>
    						<span class='{label.span.class}'>{stars.label}</span> 
    						{stars.markup}	
    					</label>
    				</p>
    				{endif.stars}
    
    				{if.honeypot}
    				<p class='{honeypot.wrap.class}'>
    					<label>
    						<span>{honeypot.label}</span>
    						<input type='text' name='{honeypot.input.name}' value='{honeypot.input.value}' size='3' />
    					</label>
    				</p>
    				{endif.honeypot}
    
    				<p class='{text.wrap.class}'>
    					<label class='{label.class}'>
    						<textarea style='border: 1.5px solid !important;' name='text' class='{text.input.class} my-comment my-new-comment' required='required' rows='{text.input.rows}' cols='{text.input.cols}'>{text.input.value}</textarea>
    					</label>
    				</p>
    
    				{if.notify}
    				<p class='{notify.wrap.class}'>
    					<label class='{notify.label.class}'>
    						<span class='{notify.label.span.class}'>{notify.label}</span>
    					</label> 
    					<label class='{notify.input.label.class}'>
    						<input class='{notify.input.class}' type='radio' name='{notify.input.name}' checked='checked' value='{notify.input.off.value}' {notify.input.off.checked}/> 
    						{notify.input.off.label}
    					</label>	
    
    					{if.notify.replies}
    					<label class='{notify.input.label.class}'>
    						<input class='{notify.input.class}' type='radio' name='{notify.input.name}' value='{notify.input.replies.value}' {notify.input.replies.checked}/> 
    						{notify.input.replies.label}
    					</label>	
    					{endif.notify.replies}
    
    					{if.notify.all}
    					<label class='{notify.input.label.class}'>
    						<input class='{notify.input.class}' type='radio' name='{notify.input.name}' value='{notify.input.all.value}' {notify.input.all.checked}/> 
    						{notify.input.all.label}
    					</label>	
    					{endif.notify.all}
    				</p>	
    				{endif.notify}
    
    				<p class='{submit.wrap.class}'>
    					<button type='submit' class='{submit.input.class} button' name='{submit.input.name}' value='{submit.input.value}'>Reply</button>
    					{form.hidden.inputs}
    				</p>
    			</form>
      ";
    
    $form->markup('form', $formMarkup);
    $form->labels('submit', 'Submit Feedback');
    $form->labels('notify', 'Email Me');
    
    // form notifications
    $form->markup('notification', "<div class='uk-alert {class}'>{message}</div>");
    $form->classes('success', 'uk-alert-success');
    $form->classes('pending', 'uk-alert-warning');
    $form->classes('error', 'uk-alert-danger');
    
    echo $form->render();
    
    
    ?>

    Child page template:

    <?php
    // Show the comment form
    echo $page->comments->renderForm();
    
    // If the submit_a_comment URL parameter is not present then redirect to parent page
    // This must go after the form render so that comment submissions will be processed before redirecting
    if(!$input->get('submit_a_comment')) 
        $session->redirect($page->parent->url);
    ?>

    Comments are now adding to the right child without redirecting! Thank you so much for your time and help. This community is amazing!

    • Like 2
  11. @Robin S thank you for taking time to test is out, I will  forward the issue on GitHub.

     

    Meanwhile, if this can't get a fix, I have been thinking about an alternative solution, but there is some more questions to it.

    I could get rid of the group-post template and giving the comment field to the group template. It would then bring only one comment form to the page and the "group-post" would then be comments with depth. My only concern would be for two kinds of inputs that would have to be added as custom fields for the form : images and page reference.

    I saw I can add the youtube link field by adding another URL field similar to the website field already existing in the comment form.

    https://processwire.com/talk/topic/760-add-a-url-field-to-the-comments-form/#comment-6346

    But I am not sure about the difficulty when it comes to add images and page reference fields... 

     

    Here is my current form for creating the group-post child as an example of the expected behavior:

    <?php
    if($input->post->post) {
    
        $upload_path = $config->paths->assets . "files/temp/";
    
        $contact_photo = new WireUpload('contact_photo'); // References the name of the field in the HTML form that uploads the photo
        $contact_photo->setMaxFiles(1);
        $contact_photo->setOverwrite(false);
        $contact_photo->setDestinationPath($upload_path);
        $contact_photo->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif'));
    
        // execute upload and check for errors
        $files = $contact_photo->execute();
    
    //removed because this input isn't required
        // Run a count($files) test to make sure there are actually files; if so, proceed; if not, generate getErrors()
        //            if(!count($files)) {
        //                $contact_photo->error("Sorry, but you need to add a photo!");
        //                return false;
        //            }
        $theUser = $user->name;
        $contentText = $input->post->body;
        $short = strlen($contentText) > 20 ? substr($contentText,0,20)."..." : $contentText;
        $whatType = $input->post->type;
    
        $p = new Page();
        $p->template = "group-post";
        $p->parent = $page->url;
        $p->title = $theUser . " - " . $whatType . " - " . $short;
        $p->types = $input->post->type;
        $p->youtube = $input->post->youtube;
        $p->body = $input->post->body;
        $p->save();
    
        $p->title = $sanitizer->text($theUser . " - " . $whatType . " - " . $short);
        $p->youtube = $sanitizer->text($input->post->youtube);
        $p->types = $sanitizer->checkbox($input->post->type);
        $p->body = $sanitizer->textarea($input->post->body);
        $p->save();
    
        foreach($files as $filename) {
            $pathname = $upload_path . $filename;
            $p->images->add($pathname);
            $p->message("Added file: $filename");
            unlink($pathname);
        }
        $p->save();
    
        //        $session->redirect("./" . $sanitizer->pageName($post->titre, true));
        $session->redirect("./");
    
        return true;
    
    
    }
    ?>
    <form action="./" method="post"  enctype="multipart/form-data">
        <div id="my-comment-form" class="discussions_message">
            <div class='avatar'>
                <?php        
    // user image instead of gravatar
    				if(count($user->images)){ 
        				$imgUrl = $user->images->last()->url;
    				} else{ 
     				   $imgUrl = $user->url;
    				} 
                ?>    
    
                <img src='<?php echo $imgUrl; ?>' data-src='<?php echo $imgUrl; ?>'>
            </div>
            <div class="infos">
                <p class='CommentFormText CommentForm_text'>
                    <textarea class='my-comment' name="body" rows="5" cols="50"></textarea>
                </p>
                <div class="radio-toolbar small CommentFormText CommentForm_text">
                    <?php
    //the page reference input, I use them as tags for a search on the page
                    $types = $pages->get('types');
                    foreach($types->children as $type){
                        echo "<input class='tags' type='radio' id='tag{$type->title}' name='type'  value='{$type->title}'/><label for='tag{$type->title}'>#{$type->title}</label>";
                    }
                    ?>
                </div>
                <div class="uploads flex-top CommentFormText CommentForm_text">
                    <div class="image-upload">
                        <label  for="upload-image">Upload your image</label>
                        <input id="upload-image" class="photo-button" type="file" name="contact_photo" hidden/>
                        <span id="file-chosen">No image chosen</span>
                    </div>
                    <div class="button">or</div>
                    <div class="youtube-upload radio-toolbar small">
    
                        <input name="youtube" placeholder="Share a youtube video...">
                    </div>
                </div>
    
    
            </div>
            <input id='post-button' type="submit" name="post" value="Post">
        </div>
    
        <script>
      // showing the name of the selected image
            const actualBtn = document.getElementById('upload-image');
    
            const fileChosen = document.getElementById('file-chosen');
    
            actualBtn.addEventListener('change', function(){
                fileChosen.textContent = this.files[0].name;
            })
        </script>
    </form>

     

    Thank a lot for your help so far! I really appreciate!

  12. Hi @Robin S, I tried to double check with the renderSuccess function redirect.

    I had a different redirect setting in the CommentForm.php file for the comments to prevent redirecting to children pages in case there was some, I put it back as it was originally to test :

    <?php
    protected function renderSuccess(Comment $comment = null) {
    
            $pageID = (int) $this->wire('input')->post('page_id'); 
    
            if($pageID && $this->options['redirectAfterPost']) {
                // redirectAfterPost option
                $page = $this->wire('pages')->get($pageID); 
                if(!$page->viewable() || !$page->id) $page = $this->wire('page');
                $url = $page->id ? $page->url : './';
                $url .= "?comment_success=1";
                if($comment && $comment->id && $comment->status > Comment::statusPending) {
                    $url .= "&comment_approved=1#Comment$comment->id";
                } else {
                    $url .= "#CommentPostNote";
                }
                $this->wire('session')->set('PageRenderNoCachePage', $page->id); // tell PageRender not to use cache if it exists for this page
                $this->wire('session')->redirect($url);
    //          $this->wire('session')->redirect("./#"); //_________________added ffor my website
                return '';
            }
    ?>

    it is actually really redirecting to the right page:

    http://localhost:888/groups/group/group-post-id-1218/?comment_success=1&comment_approved=1#Comment68

    but adding to the wrong one:

    1866579870_Capturedcran2022-05-2811_16_09.thumb.png.1619a872843aa66bba17cbd43d502c04.png

  13. Hi everyone, I am new to processwire and I love it so far but got a bit of challenges with the FieldTypeComments module. I have been working on a website that has groups, in each group members can post images, youtube video or plain text that will create a new child to the group (group-post). I have a basic form for this, filling the fields of the new page with the different inputs the members want to share. The idea is that members can also respond to someone else's post, hence those page children have the comment field from FieldTypeComments module.

    (basically home/groups/group/group-post)

    The pages having the group-post template aren't supposed to be accessed directly, only the page having the group template. All the content of their fields are called this way :

    <!-- //group template  -->
    <?php
    //get children (group-post template)
    foreach ($page->children->find("sort=-created") as $post ){
    
        echo $post->title;
    
        echo "<p class='CommentHeader'>";
        $post->of(false);
        $numTotal = $post->comments->count();
        if($numTotal <= 1){
            echo "{$numTotal} comment";
        }else{
            echo "{$numTotal} comments";   
        }
        echo "</p>";
    
        echo $post->body;
    
        if($post->get('comments')->count()){
            $list = $post->comments->getCommentList([
                'className' => 'CommentListCustom',
            ]); 
    
            $list->setMarkup([
                'noticeMessage' => "<div id='{id}' class='uk-alert {class}'>{message}</div>",
                'noticeSuccessClass' => 'uk-alert-success',
                'noticeErrorClass' => 'uk-alert-danger',
                'list' => "<ul id='my-comments-list' class='{class}'>{comments}</ul>", 
                // and so on for any other $markup properties
            ]); 
    
            echo $list->render();
        }else{
            echo"<small><p style='text-align:center;'>No comment yet, be the first!</p></small>";
        }
    
        $form = $post->comments->getCommentForm([
            'className' => 'CommentFormCustom',
        ]);
    
        $formMarkup = "
        <form class='{form.class} discussions_message ' id='my-comment-form' action='{form.action}' method='{form.method}' {form.attrs}>
                    <div class='avatar'>";
    
        if(count($user->images)){ //profile image for the user since I am not using gravatar
            $imgUrl = $user->images->last()->url;
        } else{ 
            $imgUrl = $user->url;
        } 
        $formMarkup .= "<img src='{$imgUrl}' data-src='{$imgUrl}'>";
    
        $formMarkup .= "
                    </div> 
    
                    <p class='{cite.wrap.class}'>
    					<label class='{label.class}'>
    						<span class='{label.span.class}'>{cite.label}</span> 
                            <textarea name='{cite.input.name}'  class='{cite.input.class}' required='required' value='{cite.input.value}' >{cite.input.value}</textarea>
    					</label>
    				</p>
    
    				<p class='{email.wrap.class}'>
    					<label class='{label.class}'>
    						<span class='{label.span.class}'>{email.label}</span> 
                            <textarea name='{email.input.name}' class='{email.input.class}' required='required' value='{email.input.value}' >{email.input.value}</textarea>
    
    
    					</label>
    				</p>
    
    				{if.website}
    				<p class='{website.wrap.class}'>
    					<label class='{label.class}'>
    						<span class='{label.span.class}'>{website.label}</span> 
    						<input type='text' name='{website.input.name}' class='{website.input.class}' value='{website.input.value}' maxlength='255' />
    					</label>
    				</p>
    				{endif.website}
    
    				{if.stars}
    				<p class='{stars.wrap.class}' {stars.wrap.attrs}>
    					<label class='{label.class}'>
    						<span class='{label.span.class}'>{stars.label}</span> 
    						{stars.markup}	
    					</label>
    				</p>
    				{endif.stars}
    
    				{if.honeypot}
    				<p class='{honeypot.wrap.class}'>
    					<label>
    						<span>{honeypot.label}</span>
    						<input type='text' name='{honeypot.input.name}' value='{honeypot.input.value}' size='3' />
    					</label>
    				</p>
    				{endif.honeypot}
    
    				<p class='{text.wrap.class}'>
    					<label class='{label.class}'>
    						<textarea style='border: 1.5px solid !important;' name='text' class='{text.input.class} my-comment my-new-comment' required='required' rows='{text.input.rows}' cols='{text.input.cols}'>{text.input.value}</textarea>
    					</label>
    				</p>
    
    				{if.notify}
    				<p class='{notify.wrap.class}'>
    					<label class='{notify.label.class}'>
    						<span class='{notify.label.span.class}'>{notify.label}</span>
    					</label> 
    					<label class='{notify.input.label.class}'>
    						<input class='{notify.input.class}' type='radio' name='{notify.input.name}' checked='checked' value='{notify.input.off.value}' {notify.input.off.checked}/> 
    						{notify.input.off.label}
    					</label>	
    
    					{if.notify.replies}
    					<label class='{notify.input.label.class}'>
    						<input class='{notify.input.class}' type='radio' name='{notify.input.name}' value='{notify.input.replies.value}' {notify.input.replies.checked}/> 
    						{notify.input.replies.label}
    					</label>	
    					{endif.notify.replies}
    
    					{if.notify.all}
    					<label class='{notify.input.label.class}'>
    						<input class='{notify.input.class}' type='radio' name='{notify.input.name}' value='{notify.input.all.value}' {notify.input.all.checked}/> 
    						{notify.input.all.label}
    					</label>	
    					{endif.notify.all}
    				</p>	
    				{endif.notify}
    
    				<p class='{submit.wrap.class}'>
    					<button type='submit' class='{submit.input.class} button' name='{submit.input.name}' value='{submit.input.value}'>Reply</button>
    					{form.hidden.inputs}
    				</p>
    			</form>
      ";
    
        $form->markup('form', $formMarkup);
        $form->labels('submit', 'Submit Feedback');
        $form->labels('notify', 'Email Me');
    
        // form notifications
        $form->markup('notification', "<div class='uk-alert {class}'>{message}</div>");
        $form->classes('success', 'uk-alert-success');
        $form->classes('pending', 'uk-alert-warning');
        $form->classes('error', 'uk-alert-danger');
    
        echo $form->render();
    
    }
    ?>

    I use the comment module on different templates that have different behaviors. It works so perfectly when the comment field is on the page receiving comments, but for the case of my group-post the comments are added from the group template to the group-post template. It actually works fine when the group only has 1 child, votes included, however, when there is multiple children the comments are always adding up to the last group-post created.

    I am worried to touch the module itself since I am still starting with ProcessWire modules and I don't want to mess up in anything before asking a bit of help, I am more than aware that this might be an unusual use of the FieldTypeComments module...

     

    Does someone ever had this issue and found a way to keep my other comment field commenting the page there are on, but making sure that the group-post comments are adding in the right group-post child?

     

    Sorry if it feels messy, and let me know if you need something else for giving some clues ?

    Any help would be greatly appreciated!

×
×
  • Create New...