Jump to content

Juergen

Members
  • Posts

    1,221
  • Joined

  • Last visited

  • Days Won

    10

Posts posted by Juergen

  1. Hello @all

    I need a Hook that will run after a user updates a module from the PW module directory.

    The reason for that is, that the update only affects files which are inside the updated module itself. If a module creates files or directories on other places of the systen, they will never get affected during an update.

    In my case, my FrontendForms module copies a file (captchaimages.php) from the module to the root directory of the PW installation during the installation process of the module. The problem is, if I update this file, running an update will never updates the file in the root directory. So this file will never be touched again after the installation.

    For this reason I need a Hook, that will run after a module was updated successfully, so I can write a code to update this file manually (or in other words to replace the file inside the root with the file from the update version).

    Can anyone help me if there is an appropriate Hook.

    Thanks in advance

  2. This is the next module beside the FrontendLoginRegister module which is based on the FrontendForms module.

    As the name suggests, it has been designed to easily create a contact form for your site with the following characteristics:

    • Fast and easy integration of a contact form inside a template by using only one line of code
    • Show/hide certain fields of the form depending on your preferences and needs
    • Beside the default fields you will be able to extend the form with additional fields if needed
    • Highly customizable (change order of fields, add custom CSS classes,...)
    • Run as many forms on one page as you want
    • Possibility to offer file upload to upload multiple files, which can be sent as attachments
    • Usage of all the benefits of FrontendForms (fe. CAPTCHA, various security settings,...)
    • Multi-language
    • IP of the sender will be send with the email too, so you can use it for IP-blocking if you will get a lot of spam from a certain IP

    configuration.thumb.png.ffd876974daf9bd4410225f596aeed16.png

    To render a complete working contact form, you will only need to add this line of code to your template:

    echo $modules->get('FrontendContact')->render();

    form.thumb.png.68979a50868c1f477f9c7a5bd89acd02.png

    The output can differ from the image above, because it depends on your settings and customizations, but it will looks like similar to the form in the image.

    This module is completely new and therefore alpha stage - so be aware of using it on live sites!

    It works as expected in my tests, but it will need further testing.

    You can download the module here: FrontendContact or you can install it via the Processwire upgrade-module from the module directory. Alternatively you will find all files inside GitHub.

    You will also find a more detailed description on the the download page.

    Live example of this module: https://www.schulfreund.at/kontakt/

    As always, please report issues or wishes here or directly on GitHub.

     

    Thanks for testing!

    • Like 7
  3. @Andy I will probably thinking over to add this feature (support for image upload). Technically, uploading an image without image manipulation should not be a problem in this case. At the moment I am quite busy on creating a new module for a contact form based on FrontendForms, but if I have more time left, I will probably give this feature a chance.

    Best regards

    • Like 1
  4. Hi Andy,

    Maybe you are thinking of profile images?

    I have thought about it, but my experience in the the past has shown me, that users do not upload profile images.

    A few years ago I have created a user registration with the opportunity to upload a profile image, but no one has used it... so I dont think so, because it would only make sense if you can manipulate (crop, position,..) the image after the upload to get the best fit for the image. This is very complex to implement.

    Best regards

    • Like 1
  5. The custom user fields will be taken from the user template and mapped to the FrontendForms class. So PW fields will be re-written to FrontendForm fields.

    Take a look at https://github.com/juergenweb/FrontendLoginRegister#support-for-custom-user-fields

    Some of the values as set in the PW fields will be added to the FrontendForm fields too.

    Example: If you take the PW password field and you have set the requirements to at least "1 letter and 1 digit", this requirement will also be used in the Frontendforms input field for the password on the frontend.

    Validation will only be taken by FrontendForms.

    Does this answer your question?

    • Like 3
  6. Ok, Claus! You are close to the solution.🙂 You will get every value by its name attribute. To add all of them to the body, I recommend you concatenate all the values in one string. 

    $email = $form->getValue('email');
    $message = $form->getValue('message');

    If you have all of your $_POST values than you create your body string (fe with a little HTML markup).

    $body = '<ul><li>Email: '.$email.'</li><li>Message: '.$message.'</li></ul>;

    As the last step, add it to the mail body:

    $m->body($body);
    
    // or if you want to use HTML markup
    
    $m->bodyHTML($body);

    You will find a working example at https://github.com/juergenweb/FrontendForms/blob/main/Examples/contactform.php

    Best regards

    PS: If you will need help, please post the code of your form here.

    • Like 2
  7. Hello Claus,

    thank you for reporting the bug - it is fixed now. There was a missing typehint declaration at the label file.

    I have updated the module now to 2.1.26 - alternatively please replace the folllowing file: https://github.com/juergenweb/FrontendForms/blob/main/Formelements/Textelements/Label.php

    On line 20 I have changed the following:

    protected int $enableAsterisk = 1;
    
    // to
    
    protected int|string $enableAsterisk = 1;

    Best regards Jürgen

    • Like 1
  8. A module for ProcessWire CMS to integrate a user registration/login functionality based on the FrontendForms module. This module creates pages and templates during the installation for faster development.

    The intention for the development of such a module was to provide a ready-to-use solution for user management, which can be installed and put into operation in a few minutes.

    It works out of the box, but it provides a lot of configuration settings in the backend:

    module-config.thumb.jpg.a85ccb0b15d57604403c399b32a31c0a.jpg

    Highlights

    • "One-click" integration of an user login/registration system without the hazzle of creating all pages and forms by hand
    • "One-click" switch between login or login and registration option
    • Double opt-in with activation link on new registrations
    • Option for automatic sending of reminder mails, if account activation is still pending
    • Option for automatic deletion of unverified accounts after a certain time to prevent unused accounts
    • Option to use TFA-Email if installed for higher security on login
    • Mutli-language
    • Select if you want to login with username and password or email and password
    • Select the desired roles for newly created users
    • Select, which fields of the user template should be displayed on the registration and profile form (beside the mandatory fields). Fields and order can be changed via drag and drop functionality
    • Offer users the possibility to delete their account in the members area using a deletion link with time expiration
    • Customize the texts of the emails which will be send by this module
    • Usage of all the benefits of FrontendForms (fe. CAPTCHA, various security settings,...)
    • Support for SeoMaestro if installed
    • Lock accounts if suspicious login attempts were made
    • Support of Ajax form submission

    This module runs on top of the FrontendForms module, so please download and install this module first.

    UPDATE 03.11.2023: The module is now available inside the Processwire modules directory: Frontendloginregister

    This module is early Beta stage, so please do not use it on live sites at the moment.

    If you discover any issues, please report them directly on GitHub 🙂. Thanks!

    • Like 15
    • Thanks 4
  9. 43 minutes ago, Zeka said:
    public function getModuleConfigInputfields(array $data) {
    		
    		....
    
    		foreach ($inputfields->getErrorInputfields() as $inputfield) {
    			$inputfield->collapsed = Inputfield::collapsedNo;
    			$parents = $inputfield->getParents();
    			
    			foreach ($parents as $parent) {
    				$parent->collapsed = Inputfield::collapsedNo;
    			}	
    		}
    		
    		return $inputfields;
    	}

    This works!!! Thank you so much!!!

    I can confirm, that the fieldset was always closed in my case. Maybe it has something to do, that the error was produced by a custom inputfield validator via a Hook.

    Best regards Jürgen

    • Like 1
  10. Hello @all

    I have a configurable module and for better overview i have created a lot of fieldsets where I have placed configuration fields inside. By default all fieldsets are closed.

    So if an error occurs in one field after saving the module, I get the error message at the top, but the fieldset which includes the field with the error keeps closed. This is not very userfriendly, because you will not know in which of the fieldsets is the field which causes the error (I know, where to look, but someon who does not know my module will not...)

    So it would be great if the fieldset with the error field inside will be opened, after the form processing.

    Is there an inbuilt way to achive this or has someone struggled with the same problem and has found a working solution and will be so kind to post it here?

    Thanks in advance

    • Like 1
  11. Hello @xweb

    The placeholder is an attribute and you can add every attribute with the setAttribute() method described here.

    $yourField->setAttribute('placeholder', 'Enter your first name');
    
    // or with translatable strings 
    
    $yourField->setAttribute('placeholder', _('Enter your first name'));

    Replace $yourField with the variable name of your field object and your done 😀!

    You can do this in the same way for every attribute (class, data-attribute, id, rel,.....).

    Have a nice day!

    Jürgen

    • Like 1
  12. Version 2.1.19 contains changes to make the module compatible with PHP 8.2 and following versions.

    All dynamically created properties have been removed and replaced by a declared property which hold all the properties inside an array. The reason for this is that dynamicalle created properties will be depreciated in 8.2 (leads to a warning) and the will be forbidden in upcoming PHP 9.

    So, this was a change affecting a huge amount of files. So please test it carefully and report any issues directly on GitHub.

    IMPORTANT!

    Due to a writing mistake, there are wrong values inside the database: These wrong values will not be overwritten during the update. It is recommended to uninstall and reinstall the module after the update to be sure that the correct values are stored inside the database. Otherwise it is most likely that you will get an error after a form submission.

    Just to mention: the error is in the fieldname of the custom messages: instead of the field name "input_alertErrorText" and "input_alertSuccessText" I have written "input_input_alertSuccessText" and "input_input_alertErrorText". This causes an error after form submission.

    Thanks a lot!

     

    • Like 2
  13. Hello @Stefanowitsch

    There was a wrong query string inside the method, which is responsible to find all frontend templates. I have corrected it on Github. You do not need to download and install the whole module. Please replace the file JkPublishPages.module from the module with the new one at Github and let me know, if it works now. I have bumped up the module version too, because this was a significant malfunction.

    BTW: you can set the child settings to no again and only to mention: the homepage is excluded from the templates.

    • Like 1
  14. My explanation, was for the parent pages, not for adding the publishing fields to the template. To clearify: This blog post template will not be visible at the checkboxes list for the templates in your case?

    I will take a closer look on my local installation and give you a feed back after lunch. I guess there will be a problem in querying templates.

    • Like 1
×
×
  • Create New...