Skip to content

Instantly share code, notes, and snippets.

View jenswittmann's full-sized avatar

Jens Wittmann – Gestaltung & Entwicklung jenswittmann

View GitHub Profile
@jenswittmann
jenswittmann / aria-helper.css
Last active November 10, 2020 14:55
HTML A11Y ARIA helpers
// hide tab focus if not needed
* {
&:focus,
&:-moz-focusring {
outline: 0 !important;
}
}
.focus-outline {
@jenswittmann
jenswittmann / .gitify
Last active December 22, 2020 10:02
Gitify config file
data_directory: _gitify/
backup_directory: _backup/
packages:
modx.com:
service_url: http://rest.modx.com/extras/
packages:
- pthumb
- pdotools
- collections
modmore.com:
@jenswittmann
jenswittmann / functions.php
Last active February 3, 2021 14:22
Timber embed SVG Plugin for WordPress
/**
* embed SVG
* Example: <span>{{ "logo"|svg }}</span>
*
* @param \Twig\Environment $twig The Twig environment.
* @return \Twig\Environment
*/
function twig_svg_embed($twig)
{
$twig->addFilter(
@jenswittmann
jenswittmann / alphabeticalLetters.php
Last active February 15, 2021 13:17
Get alphabetical Letters from MODX PDO Collection
<?php
/**
* alphabeticalLetters
*
* DESCRIPTION
*
* This Snippet return alphabetical Letters from Collection
*
* PROPERTIES:
*
@jenswittmann
jenswittmann / csvparse.php
Created February 18, 2021 10:37
This MODX Snippet parse CSV Data and return it to chunk
<?php
/**
* csvParse
*
* DESCRIPTION
*
* This Snippet parse CSV Data and return it to chunk
*
* PROPERTIES:
*
@jenswittmann
jenswittmann / dateconvert.php
Created February 18, 2021 10:37
This MODX Snippet convert german date DD.MM.YYYY to YYYY-MM-DD
<?php
/**
* dateConvert
*
* DESCRIPTION
*
* This Snippet convert DD.MM.YYYY to YYYY-MM-DD
*
* PROPERTIES:
*
@jenswittmann
jenswittmann / custom-js.html
Created March 4, 2021 10:47
Accordion for WordPress Lay Theme
<!-- Custom HTML at bottom -->
<script>
window.laytheme.on( "newpageshown", function( layoutObj, type, obj ) {
var akkordeonActiveClassName = "akkordeon--active",
akkordeonBtnEls = document.querySelectorAll("[href^='#akkordeon_']");
akkordeonBtnEls.forEach( function( akkordeonBtnEl, i ) {
var akkordeonChildClass = akkordeonBtnEl.getAttribute("href").replace("#", ""),
akkordeonChildEls = document.querySelectorAll( "." + akkordeonChildClass );
akkordeonBtnEl.addEventListener( "click", function( e ) {
@jenswittmann
jenswittmann / collections.imageplus.js
Created July 31, 2018 12:52
Custom MODX Collections renderer for Image+ with cropping
collections.renderer.imageplus = function(value, metaData, record, rowIndex, colIndex, store) {
if (value != '' && value != null) {
var data = Ext.decode(value);
var url = MODx.config.connectors_url + 'system/phpthumb.php?imageplus=1';
var params = {};
params.src = 'upload/'+MODx.config['collections.renderer_image_path'] + data.sourceImg.src;
params.w = 100;
if (data.sourceImg.src.indexOf('.png') !== -1) {
params.f = 'png';
@jenswittmann
jenswittmann / gist:9d052880af64d00793a619ad32c68c87
Created April 24, 2021 14:29
MODX MIGX CMP for News filtering by TV
{
"formtabs":"",
"contextmenus":"",
"actionbuttons":"",
"columnbuttons":"",
"filters":[
{
"MIGX_id":1,
"name":"categorie",
"label":"Kategorie",
@jenswittmann
jenswittmann / a readme.md
Created November 24, 2022 13:16 — forked from Mark-H/a readme.md
modCli; using MODX on the commandline.

modCLI

modCLI is a wrapper for the MODX Revolution Processors, allowing you to pretty much do anything from the commandline that you would normally do within the manager.

To use modCLI, simply download the modcli.php file and put it in the MODX_BASE_PATH of your installation. Next open up the console or terminal, and start firing some commands at it.

Syntax