Skip to content

Instantly share code, notes, and snippets.

View ademers's full-sized avatar
🧡

Andrea ademers

🧡
View GitHub Profile
<form-validation inline-template>
<form ref="form"
class="uk-form-stacked"
id="score-image"
method="post"
accept-charset="UTF-8"
enctype="multipart/form-data"
novalidate
>
{{ csrfInput() }}
{# NOTE: Required so that judges don't override other judges' matrix blocks! #}
<!-- Matrix blocks exist -->
{% if entry.judgeSelections|length %}
{% for block in entry.judgeSelections.all() %}
<input type="hidden"
name="fields[judgeSelections][{{ block.id }}][type]"
value="judgeSelection"
>
<input type="hidden"
name="fields[judgeSelections][{{ block.id }}][enabled]"
Checking for pending migrations ...
Total 1 new Asset Metadata migration to be applied:
- m180919_000000_craft3
Backing up the database ... done
*** applying m180919_000000_craft3
> update in {{%fields}} ... done (time: 0.002s)
Exception: Undefined index: defaultValue (/home/vagrant/sites/example/vendor/carlcs/craft-assetmetadata/src/migrations/m180919_000000_craft3.php:39)
#0 /home/vagrant/sites/example/vendor/carlcs/craft-assetmetadata/src/migrations/m180919_000000_craft3.php(39): yii\base\ErrorHandler->handleError(8, 'Undefined index...', '/home/vagrant/s...', 39, Array)
#1 /home/vagrant/sites/example/vendor/craftcms/cms/src/db/Migration.php(52): carlcs\assetmetadata\migrations\m180919_000000_craft3->safeUp()
{
"name": "craftcms/craft",
"description": "Craft CMS",
"keywords": [
"craft",
"cms",
"craftcms",
"project"
],
"license": "MIT",
@ademers
ademers / Keybase.md
Created March 22, 2021 16:02
Keybase

Keybase proof

I hereby claim:

  • I am ademers on github.
  • I am ademers (https://keybase.io/ademers) on keybase.
  • I have a public key ASCkjUcb7mMCFNPNoFOoZGVWhnM95gsxD9MKRTQSy5cVBgo

To claim this, I am signing this object:

How I Install and Uninstall Craft CMS Plugins

⏳ 2 minute read

In this article, I describe the steps that I follow to install Craft CMS 3.5.x plugins.

Assumptions

  • Craft 3.5.x is installed in local development and production environments.
  • Composer 1.3.0 or later is installed in local development and production environments.
@ademers
ademers / craft-cms-postmark-mailer-component.php
Last active March 29, 2023 10:51
Craft CMS Postmark Mailer Component
<?php
return [
'components' => [
'mailer' => function() {
// Get the stored email settings
$settings = craft\helpers\App::mailSettings();
// Override the transport adapter class
$settings->transportType = craft\postmark\Adapter::class;
@ademers
ademers / app.php
Last active December 5, 2020 17:58
<?php
/**
* Yii Application Config
*
* Edit this file at your own risk!
*
* The array returned by this file will get merged with
* vendor/craftcms/cms/src/config/app.php and app.[web|console].php, when
* Craft's bootstrap script is defining the configuration for the entire
* application.

How I Update Craft CMS 3.5.x and Craft CMS Plugins

⏳ 2 min read.

Update apnea: the temporary cessation of breath when updating Craft and Craft plugins.

This article describes the steps I follow to update Craft 3.5.x and plugins in a stress-free and reliable manner. 🧘

Photo of blue and pink sea by Harli Marten Photo by Harli Marten on Unsplash

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Contact Form Plugin Example with Axios</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.js"></script>
</head>
<body>
<!--