4

When you specifically group on dateField.day (in your case, the |group('datum.day') part), the group filter won't care about the month or year for the date field – only the day. This means that any entry posted on the 22nd of any month in any year will be grouped together, which is probably not what you want. In this case, the solution is simply to group on ...


4

Solution: {% if block.myFormField|length %} {{ block.myFormField.first().displayForm() }} {% endif %}


4

Note: I've never used amforms nor mPDF, so I'm on a bit thin ice with this answer – hopefully it'll prove semi-useful, though. How do I add the mPDF library to Craft? To include any third-party PHP library in Craft, you'll need to build a custom plugin, since that's the only real way to write (or include) PHP inside a Craft CMS app. Craft plugins are ...


3

Here is a working example using mPDF 6.1. Thanks to Mats Mikkel Rummelhoff for pointing me in the right direction. Note: the event you need is amForms_submissions.onBeforeEmailConfirmSubmission. This event contains the confirmation email, so you can add your attachment straight to it. public function init(){ require_once __DIR__ . '/vendor/autoload....


3

I am not a big fan of using segments for form submission pages. It's an oldschool EE habit and these are pages you don't want listed anyway so query away. Maybe just have your form success page set to ?m=thankyou so it appends to the current url and retains the previous segments. In your form: <input type="hidden" name="redirect" value="?m=thankyou"> ...


3

Enable CSRF protection in your config again and add {{ getCsrfInput() }} right after the <form> opening tag on all forms on your site, regardless if they are amforms or mailchimp subscribe. I can verify that it won't interfere with the mailchimp plugin as I am currently (and just recently) installed it on a project I'm working on and it works fine.


3

If you want to upload assets with your form, you will need to include enctype="multipart/form-data" in your form tag: <form method="post" accept-charset="UTF-8" enctype="multipart/form-data" ...


2

Ok, I figured it out. First, to solve the birthday input problem, I used javascript to gather the values of each individual date dropdown and assemble them into a hidden text input that would be what passes in the datetime value to Craft. No problem. However, the datetime formatting tripped me up because there are two posts here that had the formatting ...


2

Of course a couple of minutes after posting this I find the answer. All you need to do is put the email field handle in the reply to email address input like this {emailAddress}


2

I've figured this out (the solution is not in the docs). Follow these steps: 1) In the amforms plugin's settings, create a custom text field called 'notificationRecipients'. 2) Add that field to your form's list of fields in the form's settings. 3) Under the notifications tab of your form, add this to your "Email Recipients" field: defaultAddress@domain....


2

There is an issue open over on their Github, asking about this and the last answer says it's something they are going to add at a later date. Ajax Sending Issue So, in short I guess not for the time being. Edit: I guess if you have the time and fancy the challenge, you could always add it yourself and do a Pull Request?


2

Am I correct in thinking that these notifications are being sent via Craft's email settings (currently PHP Mail)? Probably. There are plenty of other reasons to not use PHP Mail on a production environment, though. If I change Craft's email protocol to GMail, how safe are the credentials I enter and are they encrypted? If you select the "GMail" as an ...


1

I believe A&M Forms stores its fields separately, it does not use the Craft fields that you would use elsewhere. You'll probably need to re-create those fields through A&M Forms to be able to access them in your forms. To be honest, you should probably stop using A&M Forms if you are not in too deep. It was never ported to Craft 3 (and never ...


1

As noted in the documentation for AM Forms the fields that are created for forms …are stored in a different context / scope than Craft's fields. and that; …they won't be shown in Craft's field list. I assume that the reverse is then also true, so fields created in Craft will not be visible in the plugin.


1

You can click on the wheel icon below Volunteer and check if the field is available there, if not you can modify the ElementType and change it's defineAvailableTableAttributes function in order to add the field/fields you want. I don't know how this plugin was build but I made several custom ElementTypes in Craft 2 with or without a custom layout and it ...


1

The following code fires the onBeforeEmailSubmission event (link) // Fire an 'onBeforeEmailSubmission' event $event = new Event($this, array( 'email' => $notificationEmail, 'submission' => $submission, )); $this->onBeforeEmailSubmission($event); So you'll have access to the $submission and to the $email as array keys in your $params ...


1

There is a switch in notification tab for doing that - Add attachments with notifications / Whether to add possible attachments to the email. Feeling stupid now :)


1

You're getting that error because Do., 07 Sep. 2017 10:32:05 isn't in a valid PHP Date/Time format when you pass it into the |date filter. Changing it to 07 Sep. 2017 10:32:05 should work.


1

I'm not sure if this is the intended way, but I rigged this up and so far it works well. {% set yankee = craft.amForms.getForm('hotel') %} {% macro foxtrot(errors) %} {% if errors %} <ul class="errors"> {% for error in errors %} <li>{{ error }}</li> {% endfor %} </ul> {%...


1

You can get the value of a specific field by using {{ submission.fieldHandle }} E.g. {{ submission.fullName }}


1

Ahh this is a bit misleading because the docs don't really spell it out. "formHandle" according to the docs really feels like it might be the variable you set your form to, but it's literally the form handle you got when you titled your form in the CMS. So if your form starts with: {% set apple = craft.amForms.getForm('fireTruck') %} your error code needs ...


1

Whenever you submit forms to Craft, your name attribute must be formatted in a certain way by adding your values to a fields[] array. In your case, the field should look like: <input type="hidden" name="fields[nomDocumentEfficy]" value="my_value"> You can see this happening if you ever inspect a form field inside an entry in the CMS, or if you ...


1

I'm confused by what you mean by "output". Do you mean: how do you write custom HTML for checkboxes or radio buttons and have them submit to amforms? If that's the case, you need to understand the name attribute always needs a fields[] array. StraightUpCraft has a great rundown of how all field types' name attributes should be formatted in order to submit ...


1

I presume the title of the entry is the name of the job. So if that's the case, just add a hidden input in the form and add the entry's title to the value. <input type="hidden" name="fields[jobTitle]" value="{{ entry.title }}"> Then make sure to create a 'jobTitle' text field in the CMS and attach it to that form.


1

I know I'm a bit late to this, but I think it's because your {{ loop.index }} is not 0-indexed, which is necessary for the array. It should look like this: <input type="hidden" name="fields[selections][{{ loop.index0 }}][col1]" value="{{ item.qty }} x {{ item.description }}"> You also need an extra valueless hidden field above the loop to collect ...


1

I was using a date picker instead of a drop-down menu to capture submissions. Here is how I captured & formatted the date/time from the front-end to store as a dateTime field in the CP. While not exactly the same, I think along with the answer @Natetronn provided and my example might help get the format correct.


1

Based on this answer to a similar question, I think you can use a date field within your Matrix and set the value using the following date format: Y-m-d Then you'd combine the three parts of the birthday (year, month, day format) into the value to be submitted. Do this via JS or you can use the HTML5 Date type (example) or some form of datepicker. Note: ...


Only top voted, non community-wiki answers of a minimum length are eligible