What's the deal with Deno? We talk with a major contributor to find out. Listen now.

Hot answers tagged

2

When you're dealing with that many fields it's definitely a non-trivial undertaking but Craft does have all the tools you need to pull it off. Your plan B is probably the most solid option. Make a new section that houses the skill entries and then set up all the radio buttons on it you'll need. You can put fields on Users directly but it gets weird as they ...


2

I ended up using the Ad Hoc Validation method of Yii2, here is the link for documentation: https://www.yiiframework.com/doc/guide/2.0/en/input-validation#ad-hoc-validation My code for validation: Plugin.php class Plugin extends \craft\base\Plugin { public function init() { parent::init(); $this->setComponents([ 'form1Validator' =&...


1

The way I handle this is by simply includeing the same template as the login page and passing a Twig variable along with it. So more specifically, my setPasswordSuccessPath is set to a unique template called password-was-reset, which has the following code in it and nothing else: {% include 'login' with { passwordWasReset: true } %} You can then read that ...


1

Errors for the users/save-user action are recorded against the user object, not the session object. If the user is logged-out, the object is named user but if they are logged-in you must use currentUser. Generally speaking you can retrieve errors from Yii objects in several ways, but for field-by-field errors, I prefer the simplicity of getFirstError() (You ...


1

I managed to get this working in the end. Here is my final code; {# Calculate entries per day #} {% set form = entry.form %} {% set todaysEntriesIndex = 0 %} {% set submissions = craft.freeform.submissions({ form: form.handle }).all() %} {# Count each submission from the day #} {% for submission in submissions %} {% if submission.dateCreated | date(...


1

You would not use the headless API to submit content in into Craft, as neither the GraphQL or Element APIs support writing. The frontend entry form functionality is fairly well documented. You would just need your frontend to build out a post request including the correct action, CSRF token, and whatever fields are needed. The action endpoint will ...


1

Short answer: yes it's possible. Longer answer: it will probably require some custom development during your implementation to get in place what you're looking for. Sprout Forms has a Tags Field in the Relations Field section of the Form Builder. On the CP side, it's just a wrapper around Craft's Tag Relations field and will work the same way for Content ...


1

You'd do this wiht a Craft plugin or module. Try giving the plugin docs a once over: https://docs.craftcms.com/v3/extend and if you have some specific questions, feel free to post back. You can also generate Craft plugin boilerplate code at https://pluginfactory.io that already has a lot of this setup for you.


1

Broadly speaking, any Form plugin that implements Forms using Elements can probably be used headlessly using Craft's Element API plugin. I'll give an example using the Sprout Forms plugin. Install the Element API plugin Add a config/element-api.php file to your project's config folder Build your API The following example creates two endpoints. The first ...


1

As Oli commented, those will only be logged if devMode is enabled, which should never be the case in production. Outside of that, Craft does have a sensitiveKeywords propery in the Security class: https://github.com/craftcms/cms/blob/develop/src/services/Security.php#L29 that defaults to these keywords: https://github.com/craftcms/cms/blob/develop/src/...


1

As mentioned in Oli's comment, there's an example of how to do this in the documentation: https://docs.craftcms.com/v3/assets-fields.html#uploading-files-from-front-end-entry-forms


1

I'm not sure if it can make a difference, but you should try to remove the white space between the two array in the name attribute. Then I think you may have to format the date value with the date filter. <label> <input :class="{ error: error['formDate'] }" type="checkbox" name="fields[formDate][]" value="{{ date.value|date('Y-m-d') }}">{{ ...


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