Skip to content

Instantly share code, notes, and snippets.

@pepebe
pepebe / getTVLabel.snippet.php
Last active September 16, 2026 14:27
Proof of concept for toggling tv groups with a select TV in MODX.
<?php
/*
getTVLabel snippet for modx 2.3
Version:
------------------
v0.0.1 (2015-03-06 16:44)
Author:
------------------
@pepebe
pepebe / Collections.renderers.markdown
Last active July 13, 2026 15:00
Collections - Setup

###Renderers:

  • this.rendYesNo - Yes/No (1/0) boolean values, coloured in green and red, respectively
  • Collections.renderer.qtip - On hover will show a qtip with value (useful for longer values)
  • Collections.renderer.pagetitleWithButtons - Pagetitle (in h2 element) with link to edit and *buttons for update, view, delete, publish (ala Articles grid view)
  • Collections.renderer.pagetitle - Pagetitle (in h2 element) with link to edit
  • Collections.renderer.pagetitleLink - Pagetitle with link to edit (smaller text than h2)
  • Collections.renderer.datetimeTwoLines - Date on first line and time on second line; date and time formats are configurable via system settings
  • Collections.renderer.datetime - Date and time on one line
@pepebe
pepebe / friendly_alias_restrict_chars_pattern.systemsetting.txt
Last active April 1, 2026 16:51
friendly_alias_restrict_chars_pattern
Original pattern
´´´
/[\0\x0B\t\n\r\f\a&=+%#<>"~:`@\?\[\]\{\}\|\^'\\]/
´´´
Also remove () and /
```
/[\0\x0B\t\n\r\f\a&=+%#()\/<>"~:`@\?\[\]\{\}\|\^'\\]/
````
@pepebe
pepebe / pepebe_updateSystemSettings.snippet.php
Last active April 1, 2026 16:39
This snippet will edit/add a number of settings to modx_system_settings.
<?php
/*
* This snippet will edit/add a number of settings to modx_system_settings.
* The $settings array MUST contain all relevant information.
* Use the example below to create your own list of relevant settings.
*
* Updating settings
* -----------------
* All settings allready present in the database are updated by this script.
* Keep in mind to send the correct type of data. So don't add "hello" to a key with xtype "combo-bolean".
@pepebe
pepebe / modx-setup.md
Created November 27, 2025 14:18 — forked from patrickatwsrn/modx-setup.md
Basic MODx setup (German localization)

Introduction

My personal notes for an opinionated MODX setup.

What is MODX?

MODX is an honest down to earth CMS with a whole lot of freedom.

Install MODX

MODX should run on most decent servers.

Procedure

@pepebe
pepebe / gist:3885399
Created October 13, 2012 17:11
MODx - Login - ActivateNotify Plugin
<?php
/* ActivateNotify Plugin
by Breezer
http://forums.modx.com/index.php?topic=53213.0%3Bwap2
8/15/2010 7:12 pm est
*/
if ($modx->event->name == 'OnUserActivate') {
// array of emails to send the notification
@pepebe
pepebe / pdf2jpg.snippet.php
Last active February 8, 2024 16:38
pdf2jpg - MODX snippet to create a thumbnail jpg from a pdf file
<?php
/*
pdf2jpg v.0.0.1
---------------------------------------
MODX snippet to create a jpg thumbnail from a pdf file
AUTHOR:
---------------------------------------
info@pepebe.de
@pepebe
pepebe / ul.reset
Created August 28, 2011 15:15
css: reset class for unordered lists
ul.reset,
ul.reset li,
ul.reset ul li {
margin:0;
padding: 0;
text-indent: 0;
list-style-type: 0;
}
@pepebe
pepebe / gist:4554926
Created January 17, 2013 09:52
SQL: Repair German "Umlaute" inside a MySQL Database.
<?php
/**
* Alle kaputten Umlaute reparieren bei Umstellung von ISO->UTF8
* Source: http://xhtmlforum.de/66480-kleines-skript-alle-umlaute-der-datenbank.html
*
* @project -
* @author Boris Bojic <bojic@devshack.biz>
* @copyright Copyright (c) 2011, Boris Bojic (DevShack)
* @version Fri, 23 Dec 2011 13:47:11 +0100
* @updated -

Purpose:

Give a visual feedback on all moregallery custom fields starting with "color".

image

Usage:

Add custom fields to moregallery.

Start the variable name with "color". "colorBg" or "colorText" are valid field names