Skip to content

Instantly share code, notes, and snippets.

@patrickatwsrn
patrickatwsrn / 01.thumbx3.readme.md
Last active March 31, 2026 11:02
Thumb3x – Dokumentation - German

Intro

thumbx3 ist eine Leistungsstarke Thumbnaillösung für MODX3.

In einem Test wurde komplexe Aufgaben wie ein Blur Filter etwa in der hälte der Zeit umgesetzt. Ob das immer so ist muß ich irgendwann mal testen.

Voraussetzungen

In der Doku habe ich keine Infos dazu gefunden. Bei mir hat es bislang keine Probleme gegeben (Hetzner + Ubuntu 24.04 + PLESK)

@patrickatwsrn
patrickatwsrn / parentRedirect.snippet.php
Last active April 29, 2025 06:00
MODX: Redirect to parent resource
<?php
/*
Purpose: Redirect a child resource that is only used to structure content of its parent.
Usage: Add this snippet to your child template
[[!parentRedirect?
&parent=`[[*parent]]`
&alias=`[[*alias]]`
<?php
/*
snippet: spamFilter
purpose: Check message of email for chinese/russian characters and badwords
usage: add snippet to validate rules and customValidator property
&validate=`message:email:spamFilter:required`
&customValidators=`spamFilter`
*/
@patrickatwsrn
patrickatwsrn / xpdo-where
Created October 11, 2023 20:49 — forked from davidpede/xpdo-where
pdoResources where examples
&where=`{ "template:IN" : [ 1,2,3 ] }
&where=`{ "template:NOT IN" : [ 1,2,3 ] }
&where=`[{"alias:LIKE":"foo%", "OR:alias:LIKE":"%bar"},{"OR:pagetitle:=":"foobar", "AND:description:=":"raboof"}]`
@patrickatwsrn
patrickatwsrn / current-user-role.php
Created July 18, 2023 10:05
wordpress - check user role of current user
<?php
/*
https://developer.wordpress.org/reference/functions/current_user_can/#comment-4083
Contributed by Ahir Hemant(Woo-Expert)
*/
$user = wp_get_current_user();
$allowed_roles = array( 'editor', 'administrator', 'author' );
if ( array_intersect( $allowed_roles, $user->roles ) ) {
@patrickatwsrn
patrickatwsrn / acf-fieldgroup_allergene.json
Last active April 4, 2023 10:57
ACF Allergene und Zusatzstoffe für WooCommerce.
[
{
"key": "group_61e968f1031de",
"title": "Allergene",
"fields": [
{
"show_column_filter": false,
"allow_bulkedit": false,
"allow_quickedit": false,
"show_column": false,
@patrickatwsrn
patrickatwsrn / acf-opening-hours.json
Last active April 4, 2023 10:52
Wordpress ACF Opening hours
/* exported from acf pro */
[
{
"key": "group_642af70225c29",
"title": "Öffnungszeiten",
"fields": [
{
"show_column_filter": false,
"allow_bulkedit": 0,
"allow_quickedit": 0,
<?php
echo dirname(__FILE__)."<br>";
$locales = ["af_NA", "af_ZA", "af", "ak_GH", "ak", "sq_AL", "sq", "am_ET", "am", "ar_DZ", "ar_BH", "ar_EG", "ar_IQ", "ar_JO", "ar_KW", "ar_LB", "ar_LY", "ar_MA", "ar_OM", "ar_QA", "ar_SA", "ar_SD", "ar_SY", "ar_TN", "ar_AE", "ar_YE", "ar", "hy_AM", "hy", "as_IN", "as", "asa_TZ", "asa", "az_Cyrl", "az_Cyrl_AZ", "az_Latn", "az_Latn_AZ", "az", "bm_ML", "bm", "eu_ES", "eu", "be_BY", "be", "bem_ZM", "bem", "bez_TZ", "bez", "bn_BD", "bn_IN", "bn", "bs_BA", "bs", "bg_BG", "bg", "my_MM", "my", "ca_ES", "ca", "tzm_Latn", "tzm_Latn_MA", "tzm", "chr_US", "chr", "cgg_UG", "cgg", "zh_Hans", "zh_Hans_CN", "zh_Hans_HK", "zh_Hans_MO", "zh_Hans_SG", "zh_Hant", "zh_Hant_HK", "zh_Hant_MO", "zh_Hant_TW", "zh", "kw_GB", "kw", "hr_HR", "hr", "cs_CZ", "cs", "da_DK", "da", "nl_BE", "nl_NL", "nl", "ebu_KE", "ebu", "en_AS", "en_AU", "en_BE", "en_BZ", "en_BW", "en_CA", "en_GU", "en_HK", "en_IN", "en_IE", "en_JM", "en_MT", "en_MH", "en_MU", "en_NA", "en_NZ", "en_MP", "en_PK", "en_PH", "en_SG", "en_Z
@patrickatwsrn
patrickatwsrn / modx.memberpages.md
Created July 31, 2022 14:01
Notes on setting up different login ideas for members

Notes on setting up different login ideas for members

Important This is work in progress and FAR away from completed.

Ideas:

  • Login webhook that sends a message to a slack message board.

MODX Extras

  • Login by jako: Loads a simple login/logout form, with password retrieval functionality and a register form snippet.
  • Auth0 by sepiariver - Log in to MODX using any/all of the Identify Providers (IdPs) supported by Auth0, such as Google, Facebook, Twitter, Github, Microsoft, Dropbox, and dozens of others, including enterprise services
@patrickatwsrn
patrickatwsrn / modx.multi-context.md
Last active July 31, 2022 14:09
Notes on setting up a multi context modx page

Notes on setting up a multi context modx page

Important This is work in progress and FAR away from completed.

Scenario one: Multiple subdomains

Use case:

I want to have two contexts:

  • Homepage: resources handling actual content
  • Static: resources handling static content like css, js, layout images.