Jump to content

marie.mdna

Members
  • Posts

    24
  • Joined

  • Last visited

Profile Information

  • Gender
    Female
  • Location
    The Netherlands

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

marie.mdna's Achievements

Jr. Member

Jr. Member (3/6)

9

Reputation

  1. Hi @Juergen To go more on details, I use the profile page created by the module (template fl_profilepage (so it shows as "/profilePage/username1")), just added the url segment option to show more content related to specific users. There is no error message/alert or PHP error, but a javascript related error "frontendforms.js?v=2.2.2:350 Uncaught TypeError: Cannot read properties of null (reading 'innerHTML') at xhr.onload (frontendforms.js?v=2.2.2:350:39)". For my specific case I believe that I can manage without the url segment for the loggedin user's profile, and keep url segments in a different template to show different users' content. I mostly wondered if there was a specific reason since it is actually my first attempt with url segments but your answer already clears the air 🙂 Also, thanks again for the modules, I am relearning how to build forms with them and I have been enjoying this transition !
  2. Hi @Juergen, sorry to bother again ! I am facing another question, I am managing profile pages for users (in combination with your module FrontendLoginRegister) using url segments. So far no form has been submitted successfully form those pages. Is there a reason, or a way to work around it ? Thanks a lot !
  3. hi @Juergen! Thank you for you very fast answer, always! I was about to edit my comment as I got some progress, but yours feels a lot more coherent; I will add my previous solution below in case it helps someone to get to your answer 😉 $upload_path = $config->paths->assets.'files/'.$page->id."/"; foreach($form->getValue('fileupload') as $filename) { $pathname = $upload_path . $filename; $p->of(false); $p->images->add($pathname); $p->save(); unlink($pathname); } Thanks again!
  4. Hi @Juergen ! I have a question about using the form to create new pages. It has worked nicely, but I am facing some issues with images upload. I haven't tried yet for page reference but that is also on the table... Here is what I've got so far, as soon as I have tried to upload images I am getting errors; is there a better way? I do have and images field in my template; and a page reference (using ASM multi select option) where I'd like to add the checked items. <?php $content = ''; $form = new \FrontendForms\Form('myform'); // some more inputs ...... $file = new \FrontendForms\InputFile('fileupload'); $file->showClearLink(true); // show an link to empty the input field under the input field $file->setLabel($page->p_title); $file->setDescription('<span>'.$page->p_upload_label.'</span>')->setPosition('beforeLabel'); // $file->setNotes('Description fileupload notes'); $file->setRule('allowedFileSize', '60000'); $file->setRule('allowedFileExt', ['jpg','png']); $file->setRule('uniqueFilenameInDir', true); $form->add($file); $items = new \FrontendForms\InputCheckboxMultiple('items'); $items->setLabel('<p>'.$page->p_select_stickers.'</p>'); foreach($pages->get("template=items")->children() as $item){ $option = $items->addOption($item->number, $item->id); } $form->add($items); $form->setSuccessMsg('<div class="success"><h2>'. $pages->success_message .'</h2></div>'); if ($form->isValid()) { // save the content as page $p = new Page(); $p->template = $form->getValue('newPage'); $p->parent = wire('pages')->get('template=parent'); $p->title = $form->getValue('title'); $p->save(); $upload_path = $config->paths->assets . "files/{$p->id}/"; $upload_url = $config->urls->assets . "files/{$p->id}/"; if(count($form->getValue('fileupload'))) { foreach($form->getValue('fileupload') as $fileItem) { $sFile = $sanitizer->pageName($fileItem, true); $pathname = $upload_path . $sFile; // Move the uploaded file to the correct directory if (wire()->files->move($fileItem, $pathname)) { $p->images->add($pathname); $p->save(); } else { // Handle the error if the file could not be moved $form->addError('fileupload', 'The file could not be uploaded.'); } } } } $content .= $form->render(); echo $content; ?> Thanks a lot !
  5. Hi @Juergen! I come with a small question, in my form, I'd like to have a text input for a unique code that users receive personally beforehand; the idea is that I will store a csv file somewhere and for the form to be valid, the input needs to match one of the codes within the csv. Any suggestion on how to do this based on the module? I imagine that it is pretty similar to the CAPTCHA question system but maybe there is a better way? Thank you so much for the module, it is truly amazing to work with !
  6. Hi @Juergen, thank you for this very fast reply ! I have access to phpmyadmin and already checked it but can't seem to find any remaining "fl_registerpage" after clearing the project from all related files from the backend and by checking around. However, I have tried to restart a fresh project and didn't face any error, I guess that I will simply spare you the trouble and start again from this version !
  7. 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: I would be more than happy to receive some help on how to properly install it and use it, thanks in advance !
  8. 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?
  9. 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,
  10. 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!
  11. perfect! That's the point I got missing!
  12. Hi @Mike Rockett! Loving the module, it is such a timesaving module! I was just quickly wondering if there would be a way to add "www." after either "http://" or "https://" since I had included those in my original sitemap?
  13. $comments = $this->wire('modules')->get('fieldtypeComments')->find('text~%=., limit=20'); foreach($comments as $comment) { // do something } Oh I see! Maybe you can try something like this, but you might have to put a limit (see this for reference https://processwire.com/api/ref/fieldtype-comments/find/ )
  14. 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. 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
×
×
  • Create New...