Skip to content

Instantly share code, notes, and snippets.

@mmikkel
mmikkel / vue.twig
Created September 15, 2016 00:38
Vue.js Craft template
{% includeJsFile('https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.js') %}
{% set script %}
Vue.config.debug = true;
Vue.config.delimiters = ['${', '}'];
new Vue({
el: '#content',
data: {
message: 'Hello Vue.js!'
@mmikkel
mmikkel / CraftMultiLocaleValetDriver.php
Created December 4, 2016 13:10
Multi locale Craft CMS driver for Valet
<?php
class CraftMultiLocaleValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@mmikkel
mmikkel / app.php
Created August 19, 2018 13:23
Craft 3 multi-env email settings
<?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/main.php and [web|console].php, when
* Craft's bootstrap script is defining the configuration for the entire
* application.
@mmikkel
mmikkel / simpleMapPropagatingFix.php
Last active June 24, 2019 21:40
Fix (hack) for propagating Ether SimpleMap ("Map") elements across all sites in Craft 3
use ether\simplemap\elements\Map as SimpleMapElement;
Event::on(
Elements::class,
Elements::EVENT_AFTER_SAVE_ELEMENT,
function (ElementEvent $event) {
if (!Craft::$app->getIsMultiSite()) {
return;
}
@mmikkel
mmikkel / ckeditor-open-in-new-tab.json
Created April 12, 2024 07:44
CKEditor config to add a "Open in new tab" option to links
"link": {
"decorators": {
"openInNewTab": {
"attributes": {
"rel": "noopener noreferrer",
"target": "_blank"
},
"label": "Open in a new tab",
"mode": "manual"
}
@mmikkel
mmikkel / ck-editor-disable-list-styles.json
Created April 12, 2024 07:45
CKEditor config to disable additional list styles
"list": {
"properties": {
"styles": false
}
}