Skip to content

Instantly share code, notes, and snippets.

Avatar

Jens Wittmann – Gestaltung & Entwicklung jenswittmann

View GitHub Profile
@jenswittmann
jenswittmann / gist:9d052880af64d00793a619ad32c68c87
Created Apr 24, 2021
MODX MIGX CMP for News filtering by TV
View gist:9d052880af64d00793a619ad32c68c87
{
"formtabs":"",
"contextmenus":"",
"actionbuttons":"",
"columnbuttons":"",
"filters":[
{
"MIGX_id":1,
"name":"categorie",
"label":"Kategorie",
@jenswittmann
jenswittmann / custom-js.html
Created Mar 4, 2021
Accordion for WordPress Lay Theme
View custom-js.html
<!-- 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 / dateconvert.php
Created Feb 18, 2021
This MODX Snippet convert german date DD.MM.YYYY to YYYY-MM-DD
View dateconvert.php
<?php
/**
* dateConvert
*
* DESCRIPTION
*
* This Snippet convert DD.MM.YYYY to YYYY-MM-DD
*
* PROPERTIES:
*
@jenswittmann
jenswittmann / csvparse.php
Created Feb 18, 2021
This MODX Snippet parse CSV Data and return it to chunk
View csvparse.php
<?php
/**
* csvParse
*
* DESCRIPTION
*
* This Snippet parse CSV Data and return it to chunk
*
* PROPERTIES:
*
@jenswittmann
jenswittmann / alphabeticalLetters.php
Last active Feb 15, 2021
Get alphabetical Letters from MODX PDO Collection
View alphabeticalLetters.php
<?php
/**
* alphabeticalLetters
*
* DESCRIPTION
*
* This Snippet return alphabetical Letters from Collection
*
* PROPERTIES:
*
@jenswittmann
jenswittmann / functions.php
Last active Feb 3, 2021
Timber embed SVG Plugin for WordPress
View functions.php
/**
* 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 / .gitify
Last active Dec 22, 2020
Gitify config file
View .gitify
data_directory: _gitify/
backup_directory: _backup/
packages:
modx.com:
service_url: http://rest.modx.com/extras/
packages:
- pthumb
- pdotools
- collections
modmore.com:
@jenswittmann
jenswittmann / instagramLatestPosts.php
Created Oct 20, 2020
instagramLatestPosts Snippet for MODX Revolution
View instagramLatestPosts.php
<?php
/**
* instagramLatestPosts
*
* DESCRIPTION
*
* This Snippet return latest posts from Instagram as iframe embed.
*
* PROPERTIES:
*
@jenswittmann
jenswittmann / aria-helper.css
Last active Nov 10, 2020
HTML A11Y ARIA helpers
View aria-helper.css
// hide tab focus if not needed
* {
&:focus,
&:-moz-focusring {
outline: 0 !important;
}
}
.focus-outline {
@jenswittmann
jenswittmann / loopjson.php
Last active Aug 21, 2020
loopJSON (MODX Snippet)
View loopjson.php
<?php
/**
* loopJSON
*
* DESCRIPTION
*
* This Snippet loop a JSON Array.
*
* PROPERTIES:
*