Jump to content

sp1ke

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by sp1ke

  1. I see...thank you for take time answering my post.
  2. The site I am working on has 2 different languages. All the other multi-language pages areworking fine. The issue arised when I tried to load a page in a modal window in the 2nd language (not the default). This is the call to modal window: <div id="modal-form" class="uk-flex-top" uk-modal> <div class="uk-modal-dialog uk-width-auto uk-margin-auto-vertical"> <button class="uk-modal-close-default" type="button" uk-close></button> <div class="uk-modal-header"> <h4 class="uk-modal-title"><?php echo $header; ?></h4> </div> <div class="uk-modal-body" uk-overflow-auto> <?php $curpage = $pages->get('template=contact-interest'); ?> <iframe src="<?php echo $curpage; ?>" width="920" height="400" uk-responsive></iframe> </div> </div> </div> It always loads the page in default language. I found out that the solution that correctly returns the page in the desired language is below: <div id="modal-form" class="uk-flex-top" uk-modal> <div class="uk-modal-dialog uk-width-auto uk-margin-auto-vertical"> <button class="uk-modal-close-default" type="button" uk-close></button> <div class="uk-modal-header"> <h4 class="uk-modal-title"><?php echo $header; ?></h4> </div> <div class="uk-modal-body" uk-overflow-auto> <?php $reserve = $pages->get('template=contact-interest'); $language = $user->language; $curpage = $reserve->localUrl($language); ?> <iframe src="<?php echo $curpage; ?>" width="920" height="400" uk-responsive></iframe> </div> </div> </div> Hope this will help someone else that faces the same problem.
  3. Different Behavior in Ajax Call Using jQuery and Javascript When I call the same ajax page using jQuery the statement if($config->ajax) { ... } is working fine returning the expected results. But when I call the same ajax page using vanilla JS the statement if($config->ajax) { ... } returns no results. If the I comment out the above statement from the page, it returns the expected results. Maybe this is a bug?
  4. Hi, This one worked for me in a multi-language field: $string = $page->getField('your_field')->getLabel();
  5. Hello Juergen, I have followed your suggestion and change the source code of my file (contact.php): $form = new \FrontendForms\Form('contactform'); $gender = new \FrontendForms\Select('gender'); Also I download the latest version from github. I still get an error message as shown in the attached picture. Do you have any idea why? Thanks in advance
  6. Hello Juergen, I tried some changes in the template file - actualy just correct the 'namespace ProcessWire' command (if I don't include the namespace command there is an error message saying that cannot find the 'Form module'). Anyway, now get a new error as shown in the attached pic
  7. Hello Juergen, I test your script in localhost server and worked fine. But when I move site to the live server I got this message: Fatal Error: Uncaught Error: Class 'processwire\Form' not found in site/templates/contact.php:63 #0 wire/core/TemplateFile.php (327): require() #1 wire/core/Wire.php (414): TemplateFile->___render() #2 wire/core/WireHooks.php (951): Wire->_callMethod('___render', Array) #3 wire/core/Wire.php (485): WireHooks->runHooks(Object(TemplateFile), 'render', Array) #4 wire/modules/PageRender.module (554): Wire->__call('render', Array) #5 wire/core/Wire.php (417): PageRender->___renderPage(Object(HookEvent)) #6 /var/www/vhosts/san (line 63 of site/templates/contact.php) I have used the latest version of your module. I am attaching you the form template file to check. The server's PHP version is 7.4.29 Do you have any idea what is wrong? contact.php
  8. Hi Juergen, Thank you again for your very detailed and informative reply. It really made everything crystal clear. These days I am finishing a translation of language csv file in greek. Would you like to send it to you, so you can add it to the module language file? Do you believe it would be better if I send you a separate csv file only with the greek translation so you may just add the new column to your csv file? Have a nice day!
  9. Hello, Thank you for your suggestion to update my PHP version. I will do it asap. I have another question: it's from the README.md file and about the sanitizer: #### setSanitizer() Method to add a sanitizer to the form field. Returns a sanitizer object. You can use all ProcessWire sanitizer methods by adding the sanitizer name inside the parenthesis of the setSanitizer() method. You can also set multiple sanitizer methods to one field if necessary. Please note: For security reasons, the text sanitizer will be applied to each inputfield automatically, so you do not have to add it manually. The only exception is input textarea, where a textarea sanitizer will be applied by default. What confused me is the 'Please note' paragraph. As I cannot understand the difference between inputfield and textarea: which one is automatically sanitized and why textarea is an exception. Do I have manually do the sanitization of the textarea input or not? For the rest, your documentation is excellent. Very clear instructions how to use the module and also a lot of examples. Very helpful - great job! Thanks in advance.
  10. Hi Juergen, I replaced the code in FrontendForms/FormeElements/Form.php line 203 public function add(object $field) // with this code public function add($field) as you suggested and the module is working fine now. Versions information: ProcessWire: 3.0.184 PHP: 7.1.18 (XAMPP server) Thank you for your quick reply. Have a nice day!
  11. Hi Juergen, I made a template based on your example code for simple contact page. But I get an error message: Aw shucks… Fatal Error: Uncaught TypeError: Argument 1 passed to Form::add() must be an instance of object, instance of Select given, called in C:\xampp\htdocs\p20\site\templates\contact.php on line 13 and defined in C:\xampp\htdocs\p20\site\modules\FrontendForms\Formelements\Form.php:203 I am attaching a screenshot of the error message and also part of the template file. Can you please help me on that? Thanks in advance
  12. Hi Juergen, I tried to install the module to processwire (latest version) and got a fatal error: Aw shucks… Fatal Error: Uncaught Error: Using $this when not in object context in C:\xampp\htdocs\p20\site\modules\FrontendForms\FrontendForms.module:41 After changing line 41 in FrontendForms.module and remove the '$this' module installed in processwire. The line 41 changed to: 'summary' => 'Create forms and validate them using the Valitron library.', Just writing this remark as maybe help some other users in module installation. I am going to test your module in the following days. Thanks for your work
  13. Hi I tried to install the module to processwire (latest version) and got a fatal error: Aw shucks… Fatal Error: Uncaught Error: Using $this when not in object context in C:\xampp\htdocs\p20\site\modules\FrontendForms\FrontendForms.module:41 After changing line 41 in FrontendForms.module from:
×
×
  • Create New...