Jump to content

Flashmaster82

Members
  • Posts

    182
  • Joined

  • Last visited

Everything posted by Flashmaster82

  1. The print output the success message. I tried with your simple form and it print out Thank you for your message. But no email received? Shouldn´t i insert some send email "noreply@...
  2. Thanks again for the reply, i tried the update it will make a new page and there is a success message. Im using Frontendform module btw. But im not receiving any mail? hmm.. Is there any settings in the Frontendform module that is important? noreply email? Do i need to install any other module to make this work? i only have the Frontendform module.
  3. Thanks for the reply. I changed to your other module Frontendform and everything works accept im not receiving any email? the email in this code changed btw. <?php namespace Processwire; ?> <div class="container col-5 tmar10"> <?php $form = new \FrontendForms\Form('contactform'); $form->setSuccessMsg(__('Your message was submitted successfully!')); $form->setErrorMsg(__('Sorry, but there are errors!')); $firstname = new \FrontendForms\InputText('scf_firstname'); $firstname->setLabel(__($fields->get('scf_firstname')->$label)); $firstname->setRule('required'); $firstname->setAttribute('class', 'w3-input w3-border w3-margin-bottom'); $form->add($firstname); $lastname = new \FrontendForms\InputText('scf_lastname'); $lastname->setLabel(__($fields->get('scf_lastname')->$label)); $lastname->setRule('required'); $lastname->setAttribute('class', 'w3-input w3-border w3-margin-bottom'); $form->add($lastname); $phone = new \FrontendForms\InputText('scf_phone'); $phone->setLabel(__($fields->get('scf_phone')->$label)); $phone->setRule('required'); $phone->setAttribute('class', 'w3-input w3-border w3-margin-bottom'); $form->add($phone); $email = new \FrontendForms\InputText('scf_email'); $email->setLabel(__($fields->get('scf_email')->$label)); $email->setRule('required'); $email->setRule('email'); $email->setAttribute('class', 'w3-input w3-border w3-margin-bottom'); $form->add($email); $legalservice = new \FrontendForms\Select('scf_legalservice'); $legalservice->setLabel(__($fields->get('scf_legalservice')->$label)); // Add options dynamically based on existing pages $legalServices = wire('pages')->find('template=legal_service'); foreach ($legalServices as $service) { $legalservice->addOption($service->title, $service->id); } $legalservice->setAttribute('class', 'w3-select w3-border w3-margin-bottom'); $form->add($legalservice); $message = new \FrontendForms\Textarea('scf_message'); $message->setLabel(__($fields->get('scf_message')->$label)); $message->setRule('required'); $message->setAttribute('class', 'w3-input w3-border w3-margin-bottom'); $form->add($message); // Note: scf_date is not added as a form field, but it will be set when saving the new page $button = new \FrontendForms\Button('submit'); $button->setAttribute('value', __($fields->get('label_send')->$label)); $button->setAttribute('class', 'w3-btn w3-round w3-blue'); $button->addWrapper()->setAttribute('class', 'w3-padding-24 w3-center'); $form->add($button); if ($form->isValid()) { // Form data is valid, save to a new page $p = new Page(); $p->template = 'contact_inquiry'; $p->parent = wire('pages')->get('template=contact'); $p->title = $form->getValue('scf_firstname') . ' ' . $form->getValue('scf_lastname'); $p->scf_firstname = $form->getValue('scf_firstname'); $p->scf_lastname = $form->getValue('scf_lastname'); $p->scf_phone = $form->getValue('scf_phone'); $p->scf_email = $form->getValue('scf_email'); $p->scf_legalservice = $form->getValue('scf_legalservice'); $p->scf_message = $form->getValue('scf_message'); // Set the scf_date field to the current date and time $p->scf_date = time(); $p->save(); // send an email $m = wireMail(); $m->to('myemail@gmail.com'); $m->fromName($form->getValue('scf_firstname') . ' ' . $form->getValue('scf_lastname')); $m->from($form->getValue('scf_email')); $m->subject(_('New message from the contact form')); $m->bodyHTML($form->getValue('scf_message') . ' <br><br> ' . $form->getValue('scf_address')); $m->send(); // Redirect to the success page wire('session')->redirect(wire('config')->urls->root . 'forfragan-skickades/'); } echo $form->render(); ?> </div>
  4. How do you choose other fields? I want a form like First name, Last name, Phone, Email, Service (dropdown select), Message.
  5. Are you planning on implementing save to new page (admin) feature? Also a feature that would be nice then is to choose if send only to a new page and not to email.
  6. I found a solution $wire->addHookAfter('Pages::added', function($event) { $page = $event->arguments(0); foreach ($this->wire->languages as $lang) $page->set("status$lang", 1); $page->save(); });
  7. Thanks for the reply. The superuser is creating the pages yes. "There is a checkbox on the right side of the second language name field." What checkbox? can´t find it.. I found a settings to disable multiple language support, but thats the opposite..
  8. also use rel='alternate' hreflang='<?=$fields->get('label_languages')->$label;?>' for links
  9. Should you use multiple sitemaps on a multi language website? On my current website (only one sitemap) i have this in the generated sitemap. https://www.example.se/ 2023-09-24T00:43:23+00:00 hourly 1.0 https://www.example.se/en/ 2023-09-24T00:43:23+00:00 hourly 1.0
  10. I have also a dropdown switch <?php $homepage = $pages->get( '/' ); $langswitch = ''; foreach ( $languages as $language ) { if ( !$page->viewable( $language ) ) continue; // is page viewable in this language? if ( $language->id == $user->language->id ) { // current user language $langswitch .= "<div class='current'>"; } else { $langswitch .= "<div>"; } $url = $page->localUrl( $language ); $hreflang = $homepage->getLanguageValue( $language, 'name' ); $langswitch .= "<a hreflang='x-default' href='$url' title='{$language->title}'>{$language->title}<div class='{$language->name}'></div></a></div>"; } echo "<div class='dropdown'> <div class='{$user->language->name}' title='Language'></div> <div class='language-switch-ph' style='display:none;'>{$langswitch}</div> </div>"; ?>
  11. In my page i have <!doctype html> <?php $label = 'label'; if ($user->language->name != 'default') { $label = "label{$user->language}";} ?> <html lang='<?=$fields->get('label_languages')->$label;?>'> so when i switch language the language is set to the correct one.
  12. I would have bought double-digit.com domain, and then for the dutch double-digit.com/nl. And also doubledigit.com with no hyphens that redirect to double-digit.com for SEO purposes. Or .be double-digit.be if the services and most customers is based in Belgium.
  13. I have 2 language, default and en. When i create a new page template "tag" i want the other language title to be copied on save. How do i hook this?
  14. I have a field "page reference" name: tags. I have a template that it reference to. In the field i have checked "Allow new pages to be created from field" But when i create a new page from that field only the default language "i have two", is indexed. When i switch to my other language site.com/en/ the new page "tag" will not show up? If i manually add a new page with the template "tag" it will show up on both languages on the page?
  15. Twitter seems not to be working at sharing? i use this ?url={url}&text={ingress}
  16. Is it possible to add Avif format?
  17. The path is correct, the problem is the syntax errors. The path to the file is site/templates/css/style.css and site/templates/scss/style.scss
  18. Same error still? Is there something else i should be adding in another file or something? <?php namespace ProcessWire; if(!defined("PROCESSWIRE")) die(); $scss = $modules->get('Scss'); $watchFiles = $files->find( $config->paths->templates . "scss", ['extensions' => 'scss'] ); $scss->compileIfChanged( input: $config->paths->templates . "scss/style.scss", watch: $watchFiles, output: 'css/style.css', style: 'compressed', ); Exception: allowPath: pathname not allowed: css/style.css (in E:\Wamp\www\Ganthor\wire\core\WireFileTools.php line 1947)
  19. I can´t this module to work. ready.php $scss = $modules->get('Scss'); $watchFiles = $files->find( $config->paths->templates . "scss", ['extensions' => 'scss'] ); $scss->compileIfChanged( input: $config->paths->templates . "scss/style.scss", watch: $watchFiles, output: 'css/style.css' style: 'compressed' ); I get error "syntax error, unexpected ':', expecting ',' or')' ? Error: Exception: allowPath: pathname not allowed: css/style.css Please help!
×
×
  • Create New...