06-08-2014 22:30:00 3886 Comments ollserg & MaxWeb for you
About We can very quickly create the form of the collar link on the site under the CMF MODX revo vikoristic package FormIt.
The process of installing packages on MODX revo will not be described in detail in this post due to its simplicity and the large amount of material on this topic on the Internet. I’ll just remind you of the sequence of actions:
<Система> - <Управление пакетами> - <Загрузить дополнения> - <Поиск>(Entered - FormIt)
N we are waiting<Загрузить>, and then<Установить>
D Let's create a new chunk and name it
Z create a chunk sendEmailTpl This describes the information sent to the email and inserts the code there:
From whom:
Telephone:
Congratulations:
here:
- Name of the director
- phone number of the director
- email address of the director
- a notice written by the manager on the site
D Next, we create a page with notifications about successful submission and payment for those who have sent notifications through the form of the return link.
for example:
Thank you for sending the sheet!
Your sheet has been successfully sent.
Our news will be sent to you shortly.
N And this side is set up with a redirect using your ID.
Chi no Don't forget to change the value of the parameter & redirectTo \u003d `178` in the place of the FormIt snippet click (in the chunk code
news
ollserg replied on Fri, 17/04/2015 - 11:07
THIS CODE FOR THE FORM OF THE CORNER CANNOT BE PRACTITED!
This is not adaptation! You have seen all the functionality! Re-read the article carefully and you will understand.
Here I have written everything down in detail, but if you still can’t find it, you can apply through the “request” form on this site.
news
Denis replied on Mon, 20/04/2015 - 17:56
FORMIT spillable window
Thank you! Get out!
Do you have a lesson on how to make it so that when you press the “submit” button, a notification about the successful submission appears in the merge window, and not on the new page?
news
ollserg replied on Thu, 23/04/2015 - 14:56
modal window
Vikorist on your site as if you were a fool. There are a lot of implementation methods, one example:
Open window 1
Here you can post any text, pictures or videos!
Well, the CSS for this code.
news
Oleksiy replied on Sun, 31/05/2015 - 16:09
modal window
Is it necessary to write it in the html templates, but the value # win1 is unknown to me? What do you need to ask here?
Thank you.
news
Oleksiy replied on Sun, 31/05/2015 - 16:17
modal window
Please clarify, but the #win1 parameter needs to be entered in the form chunk, so that in the html template the message is sent to you, so you need to click on it? Maybe I’m not sane right now, but it’s a row
Is it necessary to write it in the html templates, otherwise the value win1 is unknown to me? What do you need to ask here?
I've known modx for only 3 days, be kind, as everything is described in a simple way.
Thank you.
news
ollserg replied on Mon, 01/06/2015 - 12:28
HTML modality code VIKNA
Hello, Guest!
news
Alex replied on Tue, 07/07/2015 - 10:18
NO LEAF
Your question, the list comes.
Having changed the fields to those required and unfortunately, the sheet stopped coming.
axis code
news
ollserg replied on Wed, 08/07/2015 - 13:09
IN! FORMIT? DESCRIBE TEXT AND EMAIL
IN! FormIt? type description required - & validate \u003d `email: email: required, text: required: stripTags`
news
Victor replied on Mon, 19/10/2015 - 14:03
THE TOPIC OF DEMORATION IN THE FORM OF A RETURNING FORMIT
Good morning, finish.
Vikoristova "& emailSubject \u003d` Sheet from the site https: // site / " - the sheet is not submitted, the form turns into a mill as if it were in the field.
.
It is clear that there is no understanding of Cyrillic coding, but what about jokes?
Please kindly tell me why. cause.
Thank you.
news
ollserg replied on Tue, 20/10/2015 - 22:47
APACHE AND PHP VERSIONS
The first thing I think is to increase respect in your view is the version of Apache and PHP on your server.
news
AlexP replied on Thu, 29/10/2015 - 14:15
PLACEHOLDER
Placeholder is trimmed..
I wanted to create “Your name” in the middle and style the css. But for some reason the code after value \u003d "" placeholder \u003d "(! LANG: Your name" is cut off !}
thank you
news
ollserg replied on Thu, 29/10/2015 - 20:01
Turn over ALL CSS connections
The "placeholder" cropping is generated by itself through layout
news
Roman replied on Fri, 27/11/2015 - 13:43
FORMIT AND PROBLEMS
This is a big minus for Fornit and the documentation before. The axis I have is the garne of the cauldron, but it’s not created by a document, but requires help from jquery! So the Formit axis doesn’t work with it.. And even though I’m trying to figure it out, I still don’t understand! Maybe you got along with something similar.
news
ollserg replied on Tue, 01/12/2015 - 23:23
AJAXFORM VIKORISTOVUVATI FOR POPUP RETURN ZVYAZKU
FormIt from the Ajax box can’t be created... Until then, FormIt needs to be written above... or AjaxForm is vikorized, which will be the best solution for a popup gateway.
news
andreev888 replied on Sat, 05/12/2015 - 22:26
SHCHOS NYAK
People can tell you that the instructions seem to be accessible from everyone else, but having completed everything according to the instructions, other than the forms on the site, I don’t bother... no matter what, no matter... It’s not just not displayed... Should you be surprised?
news
ollserg replied on Sun, 06/12/2015 - 23:37
MODX REVOLUTION - clear cache
And what is in the Menu - Website and Update the website (Clear the website cache) This is first, which falls on the thought. Well, it’s all simple, re-read the post once or twice and you’ll get it all!!!
news
Evil replied on Fri, 18/12/2015 - 07:00
ANGRY
You are tempted to copy the same articles! Come up with your own or you would like to change the code in the statistics!
news
ollserg replied on Fri, 18/12/2015 - 14:28
CODE TYPE FORMS READERS HAVE ALREADY MADE MINUTES
They blamed their food because of the inadequacy of this code.
You can read more in the comments.
Otherwise, a lot of people (there are no exact statistics) thoughtlessly copy and paste the code of this article onto their websites without having read it. I have carefully copied the code for the turnaround form from my site and indicated in the article the place in the code that I need to change to my own. And how many lists from sites went to my email before I corrected the addresses in the code?! There are not hundreds of them, just dozens.
news
svbel replied on Thu, 02/06/2016 - 10:11
CLEANING WHEN STRINGING ELECTRONIC SHEETS
What does the message “A message was sent when you tried to send mail. It is impossible to start the mail function.”?
news
ollserg replied on Thu, 02/06/2016 - 10:54
IT IS IMPOSSIBLE TO START THE MAIL FUNCTION.
There can be many reasons. Do you see logs, assignments in FormIt mail domain and mail appear and work normally?
Ask the support of your hosting provider. There is no clear answer to your question.
news
Denis replied on Wed, 15/06/2016 - 15:53
DO NOT APPLY TO THE POST OFFICE
Good afternoon! Having completed the form according to your description, everything is completed, the documents are moved to the side, and nothing arrives in the mail
Hosted website. Behind the idea everything is in code
Can you tell me what the problem is? Thank you!
news
ollserg replied on Fri, 17/06/2016 - 12:17
MODX COVERAGE FORM IS 100% CORRECT. FOLLOW THE INSTRUCTIONS.
Read the article carefully. Revert respect to chunk
Creation of code to remove the AjaxForm snippet wiki
We open the template that will be used to select the resource and enter the code that will work.
[[! AjaxForm? & Form \u003d `tpl.AjaxForm` & snippet \u003d` FormIt` & hooks \u003d `FormItSaveForm, email` & emailSubject \u003d` Test message` & emailTo \u003d ` [Email protected]`&EmailFrom\u003d` [Email protected]`& EmailTpl \u003d` tpl.email` & validate \u003d `name: minLength \u003d ^ 2 ^, email: email: required, message: minLength \u003d ^ 10 ^` & validationErrorMessage \u003d `The form has some form! & SuccessMessage \u003d `Message sent successfully`] ]
Let's take a look at the main parameters:
- & Form - indicates the chunk to place the form (tpl.AjaxForm).
- & Snippet - snippet that summarizes the form (FormIt).
- & Hooks - hooks that will wrap the FormIt snippet after a successful form update (1 - FormItSaveForm, 2 - email). Hooks are scripts that are launched after the form has been validated. They are ordered through whom and are launched one by one. If one of them has a problem, then the others will not start. In this lesson we will use 2 hooks. FormItSaveForm hook for saving forms in the database. Hook email instructions for sending the form data by mail.
- & EmailSubject, & emailTo, & emailFrom, & emailTpl - parameters, the meaning of which is the email hook. They are used for inserting sheet topics (&emailSubject), sending address (&emailTo), From header (&emailFrom), sheet template (&emailTpl).
- & Validate - parameter, on the value subset of which the form is validated. The parameter values are a list of elements divided into groups. The skin element is composed of the name of the form element (which needs to be verified) and the rule (possible before), separated from each other by the double sign. For example, the name validator: minLength \u003d ^ 2 ^ checks that the name field contains at least 2 characters. Validator email: email: required verifies that the mail field matches the email address. The basic rules for creating validators can be found on the “FormIt Validators” page.
- & ValidationErrorMessage - indicate the notification that will be displayed in the validation form.
- & SuccessMessage - a notification to inform the customer that the notification will be successfully sent.
It’s impossible to create the tpl.email chunk, which will replace the leaf template.
Congratulations
From: [[+ name]]
Email: [[+ email]]
Phone: [[+ phone]]
Message: [[+ message]]
MODX - Chunk tpl.emailRespect: To display the meaning of the form fields, placeholder is used.
Demonstration of the robotic form of the gate link
The main points when working with the form of a collar link on the side are demonstrated in addition to the following images.
MODX - A form of the collar that has not been validated
To create a form on Modx without spam, you need to create it with additional invisible fields:
1. Ajaxform and Formit components can be configured and installed
2.
The form is very easy to click on, you’re welcome to contact us
[[! AjaxForm? & Snippet \u003d `FormIt` & form \u003d` tpl.AjaxForm..ru `& emailTo \u003d` [Email protected] site` & validate \u003d `name: required, email: required, message: required, work-email: blank` & validationErrorMessage \u003d` The form has a lot to spare! `& successMessage \u003d` Thank you for your application! We will contact you as soon as possible.` & emailTpl \u003d `mailtpl`]]
Or through the Fenom template engine, the axis is like this:
($_Modx-\u003e runSnippet("! AjaxForm", [ "snippet" \u003d\u003e "FormIt", "form" \u003d\u003e "tpl.AjaxForm.example", "hooks" \u003d\u003e "email, spam" "emailFrom"\u003d\u003e" [Email protected]"," EmailSubject "\u003d\u003e" Application from the site daruse.ru "," emailTo "\u003d\u003e" [Email protected]"," Validate "\u003d\u003e" name: required, email: required, message: required, work-email: blank "," validationErrorMessage "\u003d\u003e" The form has some troubles! "," SuccessMessage "\u003d\u003e" Thank you for your application! We will contact you as soon as possible. "," EmailTpl "\u003d\u003e" mailtpl ",]))
Description of parameters:
- snippet - snippet for processing AjaxForm, set Formit - this is how it sends the sheets
- form - chunk of the form, varto that is for processing
- hooks - hooks to protect against spam
- emailFrom - addresses in which form to receive the list
- emailTo - addresses of which email list
- validate - validation, there are also two invisible fields
- validationErrorMessage - notifications that will be displayed if fields are not entered successfully
- successMessage - notifications that will be displayed if they are added to the sheet
- emailTpl - chunk in which the template is saved to receive emails (read about this below)
3. After this, we go to our form design chunk, in this section tpl.AjaxForm.example and add after the form tag, there are two fields.
Now, according to your form, you are not obliged to go through spam, for the sake of two new fields.
4. External view of leaves coming
For instructions, come to the post office with a sheet without any formatting in an unreadable format. So let's draw up a few of our sheets on the butt.
A sheet template is a simple chunk, which we specify in the parameter emailTpl, Everything is very simple here, I’ll write an example of the design. If there will be food, write in the comments.
mailtpl:
On the website [[++site_url]] application was abandoned.
[[+ Name: notempty \u003d`Name: [[+ name]]
`]] [[+ Email: notempty \u003d`Mail: [[+ email]]
`]] [[+ Message: not empty \u003d`Message: [[+ message]]
`]]Kindly contact him as soon as possible.
Don’t rely on this whole sheet, as it’s more automatic.
Read about creation and protection against spam.
Good afternoon! Today I will tell you about the created form of the gateway link for Modx Revolution, the trick of which will be an emergency captcha (since Google’s qaptcha is too foldable and bulky). Robiti is the gateway call and we will follow up with additional help Formit. You can install it yourself, melodiously, but for those who don’t know how to do it, I’ll still write out the lesson from beginning to end. Let's start!
I will skip all the moments related to installing MODX Revolution, setting up the system, designing the site, and so on. Let's finish installing the Formit package.
1. Go to System - Package Management
2. Printed "Zavantazhiti additional"
3. Select from the Formit list
Embossed "zavantazhit". Once you have downloaded Formit, you will see the downloaded packages, press the install button. Formit installations!
4. Next, a new chunk is created
Call it “form” and insert the following code:
[[! Qaptcha]] [[! FormIt? & Hooks \u003d `spam, email, redirect` & emailTpl \u003d` sentEmailTpl` & emailSubject \u003d `Request for return call` & emailTo \u003d` your email address` & redirectTo \u003d `side page id "Sheet successfully sent" ` & validate \u003d `contact_name: required, contact_phone_NA_format: required` & customValidators \u003d` qaptcha.Slider`]]
Here is the snippet of the Formit snippet, the form and the captcha, which we can easily perform at the following points. Not forgotten in the parameter emailTo show the postal note, come to the sheet of guilt, and in redirectTo You need to put the page ID "Sheet sent successfully"
5. Create a sentEmailTpl chunk
You will be told what information to send to the mail and insert the code there:
Name: [[+ contact_name]]
Email: [[+ contact_email]]
Phone: [[+ contact_phone_NA_format]]
Note: [[+ contact_message]]
6. Create a new document under the name “Sheet successfully sent”
Instead of the resource, you can insert text like: We took your sheet! Thank you for choosing our company. Our manager will contact you as soon as possible with the contact phone number you have left in the application!
7. Now let’s do the captcha itself
Connect to the jquery library page:
8. Creating catalogs assets/components/qaptcha/ і core/components/qaptcha/
To catalog assets/components/qaptcha/ place the folder images and jquery instead, and in core/components/qaptcha/ - php folder with Qaptcha.jquery file
9. Create a Qaptcha snippet
And let’s put the following code there:
regClientCSS(MODX_SITE_URL. "assets/components/qaptcha/jquery/QapTcha.jquery.css"); $Modx-\u003e regClientScript(MODX_SITE_URL. "Assets/components/qaptcha/jquery/jquery-ui.js"); $Modx-\u003e regClientScript(MODX_SITE_URL. "Assets/components/qaptcha/jquery/jquery.ui.touch.js"); $Modx-\u003e regClientScript(MODX_SITE_URL. "Assets/components/qaptcha/jquery/QapTcha.jquery.js"); $Modx-\u003e setPlaceholder("qaptcha.Slider", "
"); $ Paramqaptcha \u003d array(); $ modx-\u003e getService(" lexicon ", " modLexicon "); $ modx- \u003e lexicon- \u003e load ( " qaptcha: default "); $ txtLock \u003d $ modx-\u003e lexicon ("Push the button to the right to unblock"); $ txtUnlock \u003d $ modx-\u003e lexicon ( "Now you can press the "Submit" button"); if (! empty ($ disabledSubmit)) $ paramqaptcha \u003d "disabledSubmit:". $ disabledSubmit; $ paramqaptcha \u003d "PHPfile: \\" ". MODX_SITE_URL. "Core/components/qaptcha/php/Qaptcha.jquery.php\\" "; $paramqaptcha\u003d" txtLock:\\ "". $TxtLock. "\\" "; $ Paramqaptcha \u003d" txtUnlock: \\ "". $TxtUnlock. " \\ ""; $ paramqaptcha \u003d implode ( ",", $ paramqaptcha); $ modx-\u003e regClientHTMLBlock ( "");All scripts and css files are connected via the snippet, and the placeholder is also clicked qaptcha.Slider
10. We place a chunk there where we want to download the captcha (and respect: where the jquery library is connected, without the library we will not work) and radio :))
Good luck to everyone and good mood for the weekend!
P.S. I have a good idea))) in the “demo” I put my mail and all the sheets that you will use to verify the script’s work will come to me)) I thank you for anecdotes and funny little stories))