This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
if (!window.Craft || !window.jQuery || typeof Craft === 'undefined') { | |
return false; | |
} | |
Craft.MatrixColorization = Garnish.Base.extend({ | |
settings: { | |
colors: [ | |
'#A7CECB', '#90ACAF', '#AAA998', '#D4D698', '#F4EBBE' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set events = craft.entries() | |
.section('events') | |
.andWhere('DATE(CONVERT_TZ(field_eventStartDate, "UTC", "Europe/Berlin")) >= ' ~ 'now'|date('Ymd')) | |
.all() %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Project_Twig_Extension extends Twig_Extension implements Twig_Extension_GlobalsInterface | |
{ | |
public function getGlobals() | |
{ | |
return array( | |
'craft' => new \craft\web\twig\variables\CraftVariable(), | |
'entry' => new \craft\elements\Entry(), | |
'asset' => new \craft\elements\Asset(), | |
'category' => new \craft\elements\Category(), | |
'currentUser' => new \craft\elements\User(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sectionHandle = 'character'; | |
$entryTypeHandle = 'character'; | |
$newEntryTypeHandle = 'newType3'; | |
$newEntryTypeName = 'A new Type3'; | |
/** @var Section $section */ | |
$section = Craft::$app->getSections()->getSectionByHandle($sectionHandle); | |
$entryTypes = $section->getEntryTypes(); | |
$entryType = ArrayHelper::filterByValue($entryTypes, 'handle', $entryTypeHandle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.youtube-player').youtube(); | |
/** | |
* Youtube Plugin | |
*/ | |
(function ($, window, document, undefined) { | |
var pluginName = 'youtube'; | |
var scriptLoaded = false; | |
var isTouch = 'ontouchstart' in window, | |
eStart = isTouch ? 'touchstart' : 'mousedown', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* How to create an ElementIndex via custom Record for Craft CMS 3.x | |
* | |
* @copyright Copyright (c) 2018 anubarak | |
*/ | |
namespace modules\mymodule\elements\db; | |
use craft\base\Element; | |
use craft\db\Query; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
// my vuex store | |
import store from './../store'; | |
axios.defaults.withCredentials = true; | |
const apiVersion = 'v1'; | |
const apiClient = axios.create({ | |
baseURL: 'https://XYZ/api/' + apiVersion + '/', | |
headers: { | |
Accept: 'application/json', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Craft::$app->getView()->hook( | |
/** | |
* @param array $context | |
*/ | |
'cp.entries.edit', | |
function(array &$context) { | |
/** @var Section $section */ | |
$section = $context['section']; | |
/** @var \craft\models\EntryType $entryType */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* ElementCreate Action: this class handles Updating and Creating Craft elements, | |
* | |
* API for Craft CMS 3.x | |
* | |
* Created with PhpStorm. | |
* | |
* @link https://github.com/Anubarak/ | |
* @copyright Copyright (c) 2019 Robin Schambach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Craft.OriginalEntryIndex = Craft.EntryIndex; | |
Craft.EntryIndex = Craft.OriginalEntryIndex.extend({ | |
afterInit: function(){ | |
this.$statusMenuBtn.data("menubtn").menu.$options[1].click(); | |
this.base.apply(this, arguments); | |
} | |
}); | |
delete(Craft._elementIndexClasses["craft\\\elements\\\Entry"]); | |
Craft.registerElementIndexClass("craft\\\elements\\\Entry", Craft.EntryIndex); |
OlderNewer